When Querying data using the Web3 API Python SDK I always get a result of none.
- Have tested with the link token address which is in the script below
- Tools already installed as required in the Readme file
- Python Script As Follows:
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: ApiKeyAuth
configuration = swagger_client.Configuration()
configuration.api_key['X-API-Key'] = ''
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-API-Key'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.TokenApi(swagger_client.ApiClient(configuration))
token_address = '0x514910771af9ca656af840dff83e8264ecf986ca' # str | Address of the contract
chain = 'eth' # str | The chain to query (optional) (default to eth)
chain_name = 'mainnet' # str | The chain name to query (optional) (default to mainnet)
format = 'decimal' # str | The format of the token id (optional) (default to decimal)
offset = 56 # int | offset (optional)
limit = 56 # int | limit (optional)
order = 'name.DESC' # str | The field(s) to order on and if it should be ordered in ascending or descending order. Specified by: fieldName1.order,fieldName2.order. Example 1: \"name\", \"name.ASC\", \"name.DESC\", Example 2: \"Name and Symbol\", \"name.ASC,symbol.DESC\" (optional)
try:
# Gets the owners of the NFTs of a given contract
api_response = api_instance.get_token_price(token_address)
pprint(api_response)
except ApiException as e:
print("Exception when calling API: %s\n" % e)
API