Package: dextools-python
DEXTools PythonA simple Python API wrapper for DEXTools.
SupportsDextools API v1andDextools API v2Installationpip install dextools-pythonObtaining API KeyTo obtain an API key, head to theDeveloper Portaland choose your plan.Getting StartedThere are 2 versions of the Dextools API.Dextools API v1andDextools API v2Version 1To get started, import the package, and initiate aDextoolsAPIinstance object by passing your API key:from dextools_python import DextoolsAPI
dextools = DextoolsAPI(api_key)You can also pass an optional user agent:dextools = DextoolsAPI(api_key, useragent="User-Agent")Version 2To get started, import the package, and initiate aDextoolsAPIV2instance object by passing your API key and your plan:from dextools_python import DextoolsAPIV2
dextools = DextoolsAPIV2(api_key, plan="trial")You can also pass an optional user agent:dextools = DextoolsAPIV2(api_key, useragent="User-Agent", plan="trial")If you don't specify any plan when instantiating the object, it will default to "partner" planAvailable plans - Setting your planYou can setup your plan when setting the object instance by providing theplanargument in the constructor. If noplanis specified, it will default to "partner" planTo set your plan after the object is created, you can use theset_plan("your_plan")methoddextools.set_plan("standard")Available values:"free","trial","standard","advanced","pro", and"partner"Version 1 QueriesBelow are a set of queries supported by theDextools API v1. All data is returned as a Python dictionary for easy data handling.Get pairs of a tokenTo get the pairs of a token, pass achain idand apair address:pair = dextools.get_pair("ether", "0xa29fe6ef9592b5d408cca961d0fb9b1faf497d6d")
print(pair)Get token detailsTo get token details, pass achain id, and atoken address:token = dextools.get_token("ether", "0xfb7b4564402e5500db5bb6d63ae671302777c75a")
print(token)You can also pass thepageandpageSizeparameters:token = dextools.get_token("ether", "0xfb7b4564402e5500db5bb6d63ae671302777c75a", 1, 50)
print(token)Get chain listTo get the chain list:chain_list = dextools.get_chain_list()
print(chain_list)You can also pass thepageandpageSizeparameters:chain_list = dextools.get_chain_list(1, 50)
print(chain_list)Get exchange listTo get the exchange list, pass achain id:exchange_list = dextools.get_exchange_list("ether")
print(exchange_list)You can also pass thepageandpageSizeparameters:exchange_list = dextools.get_exchange_list("ether", 1, 50)
print(exchange_list)Version 2 QueriesBelow are a set of queries supported by theDextools API v2. All data is returned as a Python dictionary for easy data handling.BlockchainGet blockchain infoblockchain = dextools.get_blockchain("ether")
print(blockchain)Get blockchains sorted by default settingsblockchains = dextools.get_blockchains()
print(blockchains)Get blockchains sorted by default settings and descending orderblockchains = dextools.get_blockchains(sort="name", order="desc")
print(blockchains)ExchangeGet dex factory infofactory = dextools.get_dex_factory_info("ether", "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f")
print(factory)Get dexes on a specific chaindexes = dextools.get_dexes("ether")
print(dexes)Get dexes on a specific chain sorted by name and descending orderdexes = dextools.get_dexes("ether", sort="creationBlock", order="desc")
print(dexes)PoolGet pool infopool = dextools.get_pool("ether", "0xa29fe6ef9592b5d408cca961d0fb9b1faf497d6d")
print(pool)Get pool liquiditypool_liquidity = dextools.get_pool_liquidity("ether", "0xa29fe6ef9592b5d408cca961d0fb9b1faf497d6d")
print(pool_liquidity)Get pool scorepool_score = dextools.get_pool_score("ether", "0xa29fe6ef9592b5d408cca961d0fb9b1faf497d6d")
print(pool_score)Get pool pricepool_price = dextools.get_pool_price("ether", "0xa29fe6ef9592b5d408cca961d0fb9b1faf497d6d")
print(pool_price)Get poolspools = dextools.get_pools("ether", from_="2023-11-14T19:00:00", to="2023-11-14T23:00:00")
print(pools)Get pools sorted bycreationBlockand descending order and providing block numbers insteadpools = dextools.get_pools("ether", from_="12755070", to="12755071", sort="creationBlock", order="desc")
print(pools)TokenGet tokentoken = dextools.get_token("ether", "0xfb7b4564402e5500db5bb6d63ae671302777c75a")
print(token)Get token lockstoken_locks = dextools.get_token_locks("ether", "0xfb7b4564402e5500db5bb6d63ae671302777c75a")
print(token_locks)Get token scoretoken_score = dextools.get_token_score("ether", "0xfb7b4564402e5500db5bb6d63ae671302777c75a")
print(token_score)Get token infotoken_info = dextools.get_token_info("ether", "0xfb7b4564402e5500db5bb6d63ae671302777c75a")
print(token_info)Get token pricetoken_price = dextools.get_token_price("ether", "0xfb7b4564402e5500db5bb6d63ae671302777c75a")
print(token_price)Get tokenstokens = dextools.get_tokens("ether", from_="2023-11-14T19:00:00", to="2023-11-14T23:00:00")
print(tokens)Get tokens sorted bycreationBlockand descending order and providing block numbers instead in descending ordertokens = dextools.get_tokens("ether", from_="18570000", to="18570500", sort="creationBlock", order="desc")
print(tokens)Get tokens sorted bysocialsInfoUpdatedand descending order and datetimes in descending ordertokens = dextools.get_tokens("ether", from_="2023-11-14T19:00:00", to="2023-11-14T23:00:00", sort="socialsInfoUpdated", order="desc")
print(tokens)Get token poolstoken_pools = dextools.get_token_pools("ether", "0xfb7b4564402e5500db5bb6d63ae671302777c75a", from_="2023-11-14T19:00:00", to="2023-11-14T23:00:00")
print(token_pools)Get token pools sorted bycreationBlockand descending order and providing block numbers instead in descending ordertoken_pools = dextools.get_token_pools("ether", "0xfb7b4564402e5500db5bb6d63ae671302777c75a", from_="18570000", to="18570500", sort="creationBlock", order="desc")
print(token_pools)RankingsGet hot poolshot_pools = dextools.get_ranking_hotpools("ether")
print(hot_pools)Get gainersgainers = dextools.get_ranking_gainers("ether")
print(gainers)Get loserslosers = dextools.get_ranking_losers("ether")
print(losers)Page and PageSize argumentsSome methods support thepageandpageSizearguments. Check out theDextools API v2documentation for more information.ExamplesCheck out theexamplesfolder for some example scripts.TestingA set of tests have been included insidetestsfolder. You will need to set an environment variable asDextoolsAPIKeyusing your API key.Supported BlockchainsDextools adds support for new blockchains from time to time.dextools.get_blockchains()to get a list of supported blockchains and their IDsAuthorsalb2001More informationdextools-python on PyPIDEXToolsDextools API v1Dextools API v2Developer Portal