RestAPI Endpoints
The page includes a list of all available Token data endpoints on DIA network. To review the data sources and methodologies used for pricing, visit the following page:
Data sourcesDigital Assets Market Data
Token Price Quotation (by address)
GET
https://api.diadata.org/v1/assetQuotation/:blockchain/:asset
Returns the quotation for a fully qualified asset (i.e. distinguished by blockchain and address). Quotations are obtained by filtering trades data with a Moving Average filter and Interquartile Range outlier detection (MAIR).
Example: https://api.diadata.org/v1/assetQuotation/Bitcoin/0x0000000000000000000000000000000000000000
Path Parameters
Name | Type | Description |
---|---|---|
blockchain* | String | Name of the blockchain for requested asset |
asset* | String | Address of the requested asset |
Token Price Quotation (by symbol)
GET
https://api.diadata.org/v1/quotation/:symbol
Get most recent information on the currency corresponding to symbol. Quotations are obtained by filtering trades data with a Moving Average filter and Interquartile Range outlier detection (MAIR).
Note: this endpoint is intended for testing purposes only; if multiple assets with the same symbol exists, data for the highest volume generating asset will be returned
Example: https://api.diadata.org/v1/quotation/BTC
Path Parameters
Name | Type | Description |
---|---|---|
Symbol* | String | Which symbol to get a quotation for, e.g., BTC. |
Quotable Assets
GET
https://api.diadata.org/v1/quotedAssets
Returns a list of assets available for quotations.
Example: https://api.diadata.org/v1/quotedAssets
Use the query parameter blockchain in order to obtain exclusively assets on the selected blockchain.
Example: https://api.diadata.org/v1/quotedAssets?blockchain=Polygon
Query Parameters
Name | Type | Description |
---|---|---|
blockchain | String | Name of the blockchain for the requested assets. |
DeFi Data
DeFi Protocols Collateral Information
GET
https://api.diadata.org/v1/synthasset/:blockchain/:protocol
The endpoint provides information on the health factor of DeFi protocols.
It takes into consideration outstanding loans, contracts' balance and compares it to synthetic token issuance. This helps to make sure that all assets are fully collateralized.
Exemplary query:
https://api.diadata.org/v1/synthasset/Ethereum/Aave-V2
Currently only Aave V2 and Aave V3 are supported on Ethereum and Avalanche blockchains.
It is possible to receive collateral information for a single token by using token filter as in example below:
To receive all asset updates data during the selected period use starttime
and endtime
filter parameters with timestamps as inputs. Here is an example:
Path Parameters
Name | Type | Description |
---|---|---|
blockchain* | String | Ethereum or Avalanche |
protocol* | String | Aave |
address | String | Token contract address. You can use either underlying token address or synthetic token to receive the data |
starttime | Integer | Unix timestamp setting the start of the return array |
endtime | Integer | Unix timestamp setting the end of the return array |
Decentralized Exchanges Pool Liquidity
GET
https://api.diadata.org/v1/poolLiquidity/:blockchain/:pool_address
Get the latest state of a DEX pool's liquidity. Example: https://api.diadata.org/v1/poolLiquidity/Ethereum/0xB4e16d0168e52d35CaCD2c6185b44281Ec28C9Dc
Path Parameters
Name | Type | Description |
---|---|---|
blockchain* | String | Name of the blockchain of the requested pool. |
address* | String | Address of the requested pool. |
Slippage calculation (for Uniswap V2 and its forks)
GET
https://api.diadata.org/v1/poolSlippage/:blockchain/:pool_address/:token1_address/:pool_type/:desired_slippage
To predict the amount of tokens required to reach a specified slippage, you can use Pool Slippage
endpoint. It works for any pool that exists on Uniswap V2 or any fork DEX on supported list of exchanges.
Here is an exemplary API call:https://api.diadata.org/v1/poolSlippage/Ethereum/0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48/UniswapV2/100
The logic is as follows:
Provide the address of the pool, select a token in which you wish to have slippage calculated (e.g. if selected ETH from ETH-USDC, it will show how much is ETH is required to move the price by selected amount) and determine the goal for price movement.
Path Parameters
Name | Type | Description |
---|---|---|
:blockchain* | String | Name of the blockchain of the requested pool (e.g. Ethereum, Moonbeam, etc.) |
:pool_address* | String | Address of the requested pool |
:token1_address* | String | Address of either of the tokens in the pool |
:pool_type* | String | Type of the pool (e.g. UniswapV2) |
:desired_slippage* | Integer | Per mille (e.g. 100 will result in 10% slippage) |
Assets Information
Blockchains
GET
https://api.diadata.org/v1/blockchains
Get a list of all available blockchains.
Exchanges
GET
https://api.diadata.org/v1/exchanges
Get a list of all available crypto exchanges.
Centralized Exchange Pairs by Exchange
GET
https://api.diadata.org/v1/pairsCex/:exchange
Get all pairs on a given exchange for which DIA is collecting trades data at the moment.
Example: https://api.diadata.org/v1/pairsCex/Kraken
Use the query parameter verified in order to get either verified or unverified pairs.
Example: https://api.diadata.org/v1/pairsCex/Kraken?verified=true
Path Parameters
Name | Type | Description |
---|---|---|
exchange* | String | Name of the crypto exchange. |
Query Parameters
Name | Type | Description |
---|---|---|
verified | Bool | If set to true, only verified pairs are returned. If set to false, only unverified pairs are returned. |
Centralized Exchange Pairs by Asset
GET
https://api.diadata.org/v1/pairsAssetCex/:blockchain/:address
Get all pairs on a centralized exchange for which DIA is collecting trades data at the moment. Include pairs across all exchanges involving the requested asset as either base- or quote token.
Example: https://api.diadata.org/v1/pairsAssetCex/Shiden/0x0000000000000000000000000000000000000000
Use the query parameter verified in order to get either verified or unverified pairs.
Path Parameters
Name | Type | Description |
---|---|---|
blockchain* | String | Name of the blockchain for the requested asset. |
address* | String | Address of the requested asset. |
Query Parameters
Name | Type | Description |
---|---|---|
verified | Bool | If set to true, only verified pairs are returned. If set to false, only unverified pairs are returned. |
Asset Last Trades
GET
https://api.diadata.org/v1/lastTradesAsset/:blockchain/:address
Get last trade timestamp for an asset.
Example: https://api.diadata.org/v1/lastTradesAsset/Bitcoin/0x0000000000000000000000000000000000000000
Path Parameters
Name | Type | Description |
---|---|---|
blockchain* | String | A valid blockchain from GET /v1/blockchains, e.g., Bitcoin. |
address* | String | A valid asset address from GET /v1/token/:symbol, e.g., 0x000000000000000000000000000000000000000 for BTC. |
Chart Points for Graphs
Exchange Chart Points
GET
https://api.diadata.org/v1/chartPoints/:filter/:exchange/:symbol
Get chart points for an exchange.
Example: https://api.diadata.org/v1/chartPoints/MEDIR120/Binance/BTC Note: Successful responses can be rather large.
Path Parameters
Name | Type | Description |
---|---|---|
filter* | string | Which filter should be applied (Available options: MA120, VOL120, MEDIR120 and MAIR120). |
exchange* | string | A valid exchange from GET /v1/exchanges, e.g., Binance |
symbol* | string | A valid symbol from GET /v1/coins, e.g., BTC. |
Query Parameters
Name | Type | Description |
---|---|---|
scale | string | Which scale the graph points distance should have. Available options: 5m 30m 1h 4h 1d 1w. |
Asset Chart Points
GET
https://api.diadata.org/v1/assetChartPoints/:filter/:blockchain/:address
Get asset details for all exchanges.
Example: https://api.diadata.org/v1/assetChartPoints/MA120/Bitcoin/0x0000000000000000000000000000000000000000
Remark: Careful! Successful responses can be rather large.
Path Parameters
Name | Type | Description |
---|---|---|
starttime | integer | Unix timestamp setting the start of the return array |
endtime | integer | Unix timestamp setting the end of the return array |
filter* | string | Which filter should be applied (Available options: MA120, MEDIR120, VOL120 and MAIR120). |
blockchain* | string | A valid blockchain from GET /v1/blockchains, e.g., Bitcoin. |
address* | String | A valid asset address from GET /v1/token/:symbol, e.g., 0x000000000000000000000000000000000000000 for BTC. |
Query Parameters
Name | Type | Description |
---|---|---|
scale | string | Which scale the graph points distance should have. Available options: 5m 30m 1h 4h 1d 1w |
Guest Quotations
Guest Symbols
GET
https://api.diadata.org/v1/foreignSymbols/:source
Get the list of available symbols along with their ITIN for guest quotations.
Example: https://api.diadata.org/v1/foreignSymbols/Coingecko
Path Parameters
Name | Type | Description |
---|---|---|
source* | string | source of the quotation |
Guest Quotation
GET
https://api.diadata.org/v1/foreignQuotation/:source/:symbol
Get the latest quotation for a token from a guest source.
Example: https://api.diadata.org/v1/foreignQuotation/CoinMarketCap/BTC Use the query parameter time in order to get the latest quotation before the specified timestamp
Example: https://api.diadata.org/v1/foreignQuotation/Coingecko/BTC?time=1647349656
Path Parameters
Name | Type | Description |
---|---|---|
source* | string | source of the quotation |
symbol* | string | Which symbol to get a quotation for, e.g. BTC |
Query Parameters
Name | Type | Description |
---|---|---|
time | number | Unix timestamp. |
Last updated