🖥
GraphQL Endpoint
DIA made API data easily accessibly through GraphQL endpoint.
You can use the following link to send GraphQL requests:
Currently only tokens price feed data is available on GraphQL.
Example of schema that can be used for quoting data:
Sample Schema
1
query
2
{
3
GetChart(
4
filter:"mair",
5
BlockDurationSeconds:120,
6
BlockShiftSeconds: 300,
7
Exchanges:[],
8
StartTime:1673621146,
9
EndTime:1673627146,
10
Symbol:"ETH",
11
BlockChain:"Ethereum"
12
) {
13
Name
14
Symbol
15
Time
16
Value
17
}
18
}
The schema will return the moving average price of ETH calculated every 5min (300 sec) by counting 2min trade blocks. Here is a breakdown of available values:
Parameter | Description |
---|---|
filter | |
BlockDurationSeconds | Determine the window for trades inclusion in seconds (e.g. 120 will include all trades into price calculation that happened during the last 2 minutes) |
BlockShiftSeconds | Determine the frequency of price updates in seconds during the selected timeframe (e.g. 600 will return price for every 5min during the selected period) |
Exchanges | Select exchanges to be included as sources for price determination (e.g. if selected Binance , Kraken - it will return prices calculated only from trades that took place on these two exchanges) |
StartTime | The start time of the preferred period for price calculation in timestamp format (e.g. 1655084380 will start calculating price from 13.06.2022 01:39:40 GMT time) |
EndTime | The end time of the preferred period for price calculation in timestamp format (e.g. 1655090649 will calculate price until 13.06.2022 03:24:09 GMT time) |
Symbol | |
Blockchain | Select blockchain of the asset (e.g. Ethereum for ETH, Bitcoin for BTC) |
Last modified 2mo ago