Returns bar chart data to track token price changes over time.
Endpoint: getBars
Method: POST
Arguments
Name | Type | Description |
---|---|---|
currencyCode | String | The currency to use for the response. Can be |
from | Int! | The unix timestamp for the start of the requested range. Required |
quoteToken | QuoteToken | The token of interest within the token's top pair. Can be |
removeLeadingNullValues | Boolean | Whether to remove leading null values from the response. Only valid with |
resolution | String! | The time frame for each candle. Available options are |
symbol | String! | The ID of the pair or token ( |
to | Int! | The unix timestamp for the end of the requested range. Required |
Response
Name | Type | Description |
---|---|---|
c | [Float]! | The closing price. |
h | [Float]! | The high price. |
l | [Float]! | The low price. |
o | [Float]! | The opening price. |
s | String! | The status code for the bar. 200 responses are ok . |
t | [Int!]! | The timestamp for the bar. |
v | [Int]! | The volume. |
volume | [String] | The volume with higher precision. |
volumeNativeToken | [String] | The volume in the native token for the network |
O, H, L, C, V, T, and S are in their abbreviated format so that you can easily insert the data into the TradingView charting library.
Example
Historical Bar Chart Query
This query returns 1 day candles for Wrapped Ethereum (0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
) on the Ethereum network (1
) over a one-week period from Wed Jun 01 2022 (1654041600
) to Wed Jun 08 2022 (1654646400
).
{
getBars(
symbol: "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640:1"
from: 1678743827
to: 1678744027
resolution: "1"
quoteToken: "token1"
) {
o
h
l
c
v
volume
s
}
}
Explore
Ask questions, share what you're working on and request new features