Skip to main content

A simple Python API wrapper for DEXTools

Project description

DEXTools Python

A simple Python API wrapper for DEXTools

Installation

pip install dextools-python

Obtaining API Key

To obtain an API key, you will need to fill up this form.

Getting Started

To get started, import the package, and initiate a DextoolsAPI instance 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")

Queries

Below are a set of queries supported by the Dextools API. All data is returned as a Python dictionary for easy data handling.

Get pairs of a token

To get the pairs of a token, pass a chain slug and a pair address:

pair = dextools.get_pair("ether", "0xa29fe6ef9592b5d408cca961d0fb9b1faf497d6d")
print(pair)

Get token details

To get token details, pass a chain slug, and a token address:

token = dextools.get_token("ether", "0xfb7b4564402e5500db5bb6d63ae671302777c75a")
print(token)

You can also pass the page and pageSize parameters:

token = dextools.get_token("ether", "0xfb7b4564402e5500db5bb6d63ae671302777c75a", 1, 50)
print(token)

Get chain list

To get the chain list:

chain_list = dextools.get_chain_list()
print(chain_list)

You can also pass the page and pageSize parameters:

chain_list = dextools.get_chain_list(1, 50)
print(chain_list)

Get exchange list

To get the exchange list, pass a chain slug:

exchange_list = dextools.get_exchange_list("ether")
print(exchange_list)

You can also pass the page and pageSize parameters:

exchange_list = dextools.get_exchange_list("ether", 1, 50)
print(exchange_list)

Testing

A set of tests have been included inside tests folder. You will need to setup an environment variable as DextoolsAPIKEY with your API key

Chain slugs

Below is a list of current chain slugs for supported blockhains:

Blockchain ID
ETHEREUM ether
BNB bnb
POLYGON polygon
FANTOM fantom
CRONOS cronos
AVALANCHE avalanche
VELAS velas
OASIS oasis
KUCOIN kucoin
METIS metis
OPTIMISM optimism
ARBITRUM arbitrum
CELO celo
TELOS telos
AURORA aurora
MOONBEAM moonbeam
MOONRIVER moonriver
HARMONY harmony
FUSE fuse
HECO heco
OKC okc
ASTAR astar
KLAYTN klaytn
IOTEX iotex
MILKOMEDA milkomeda
DFK dfk
SOLANA solana
EVMOS evmos
DOGECHAIN dogechain
ETC etc
GNOSIS gnosis
BITGERT bitgert
CANTO canto
FLARE flare
ARBITRUMNOVA arbitrumnova
REDLIGHT redlight
CONFLUX conflux
SMARTBCH smartbch
KARDIA kardia
TOMB tomb
WAN wan
BOBA boba
ELASTOS elastos
NOVA nova
HOO hoo
SHIDEN shiden
FUSION fusion
RSK rsk
CUBE cube
SYSCOIN syscoin
KAVA kava
THUNDERCORE thundercore
ECHELON echelon
METER meter
KEK kek
TOMO tomo
RONIN ronin
SHIB shib
ETHW ethw
ETHF ethf
MUU muu
SX sx
ALVEY alvey
APTOS aptos
MULTIVERSX multiversx
ProofOfMemes pom
EXOSAMA exosama
ENERGI energi
GOERLI ethergoerli
CORE DAO coredao

Authors

More information

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dextools_python-0.1.3.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dextools_python-0.1.3-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file dextools_python-0.1.3.tar.gz.

File metadata

  • Download URL: dextools_python-0.1.3.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.9.13 Windows/10

File hashes

Hashes for dextools_python-0.1.3.tar.gz
Algorithm Hash digest
SHA256 9e81d700d746fe0a47dec3bdcbdad0207af1cf9725f0bacfa1222fbc193b3ba3
MD5 c65160465806e1e0283baf72dac0353c
BLAKE2b-256 8ff2bb4e2cb2a1a1082f4115b31ca980eac665d8f6209181ca4a95cfadf0c024

See more details on using hashes here.

File details

Details for the file dextools_python-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: dextools_python-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.9.13 Windows/10

File hashes

Hashes for dextools_python-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 10dec97ef1ed019c80727b59b41e6cbd5c0f7fe17c38fd64a7e1d2933e9d999c
MD5 9f41a822114c9e646d1ed2e3c2d6f062
BLAKE2b-256 aa95bdb57b0e5a9ae7b677f73b08107701237312f45c3d0f310ea3f68b42ad01

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page