API Reference

Return the all time highest and lowest price, as well as the first and most recent price for up to 10,000 tokens in a single request.

Method: GET or POST

Endpoint: https://api.syve.ai/v1/price-api/batch-all-time-ohlc

📘

Fetching 10,000 tokens in a single request

You have to use a POSTrequest. GET requests are limited to 25 addresses per request. Look at the example at the bottom of this page for how to construct a POST request.

Request Parameters

NameType(s)Description
token_addressstringThe list of token addresses to return all time OHLC for.

If making a GET request use a comma separated string to provide the list of addresses. If POST use a list in the request body.

This is a required parameter.
pool_addressstringThe pool address from which to get the all time OHLC price from.

The default is all.
price_typestringThe type of price to return in the response.

The default is price_token_usd_robust_tick_1.

📘

Possible Price Types

The possible price types correspond to the prices returned by our DEX Trades table. Each price type corresponds to a different method of calculating price.

Price TypeDescription
price_token_usd_tick_1The price at which a token was traded based on the most recent swap.
price_token_usd_robust_tick_1The same as price_token_usd_tick_1 but with significant outliers removed.

Response Fields

NameTypeDescription
token_addressstringThe address of the token.
price_{open|high|low|close}doubleThe all time open, high, low and close price.
timestamp_{open|high|low|close}integerThe time at which the all time open, high, low and close occurred.
transaction_hash_{open|high|low|close}stringThe transaction hash of the all time open, high, low and close.

Example: The all time OHLC price for $UNIBOT and $PEPE

📘

Try it out

In the Live Example section you can try out the request with different arguments.

Query

In the requests below 0xf819d9cb1c2a819fd991781a822de3ca8607c3c9 is the address of $UNIBOT and 0x6982508145454ce325ddbe47a25d4ec3d2311933 of $PEPE.

Example GET Request

Request: https://api.syve.ai/v1/price-api/batch-all-time-ohlc?token_address=0xf819d9cb1c2a819fd991781a822de3ca8607c3c9,0x6982508145454ce325ddbe47a25d4ec3d2311933

Example POST Request

curl --location --request POST 'https://api.syve.ai/v1/price-api/batch-all-time-ohlc' \
--header 'Content-Type: application/json' \
--data '{
    "token_address": [
        "0xf819d9cb1c2a819fd991781a822de3ca8607c3c9",
        "0x6982508145454ce325ddbe47a25d4ec3d2311933"
    ]
}'

Try in Postman: https://www.postman.com/dark-equinox-191074/workspace/syve-examples/request/11895150-f0bbc1e1-a80c-4755-9534-dadcd0603739?ctx=documentation

Response

[
    {
        "token_address": "0x6982508145454ce325ddbe47a25d4ec3d2311933",
        "price_open": 1.061260904899182e-11,
        "price_close": 1.382263583791098e-06,
        "price_high": 4.80220094287995e-06,
        "price_low": 1.061260904899182e-11,
        "timestamp_open": 1681493687,
        "timestamp_close": 1704200111,
        "timestamp_high": 1683305279,
        "timestamp_low": 1681493687,
        "transaction_hash_open": "0xc3760b499850b19d8f266dc10349d70f69c91698233697cbad2ee90ff957ed17",
        "transaction_hash_close": "0xf2de03342acbc15c7338079357889b5358ddf6c2093180bb2ec32b423ba520dc",
        "transaction_hash_high": "0x3fb217be213a38a0d037410d3cf90fcb93de88f250f41fe0b13d1d31d4c67fc3",
        "transaction_hash_low": "0xc3760b499850b19d8f266dc10349d70f69c91698233697cbad2ee90ff957ed17"
    },
    {
        "token_address": "0xf819d9cb1c2a819fd991781a822de3ca8607c3c9",
        "price_open": 15.68816773910034,
        "price_close": 67.50455437999116,
        "price_high": 268.39412117836844,
        "price_low": 12.29960221065891,
        "timestamp_open": 1686767519,
        "timestamp_close": 1704200147,
        "timestamp_high": 1691966135,
        "timestamp_low": 1686779291,
        "transaction_hash_open": "0x7e6a7f8e1434158ea856fd9a8d1b3372ed946bc70ab21cbc375c97c0b54a1351",
        "transaction_hash_close": "0xe426f5bb74c493ca9312d4ec2d5d3b1becc685a09c0d67ac84e6b5f1bc4412ee",
        "transaction_hash_high": "0xa30ca0fe66f7fde90b97978151e336a45ec840cd942eb35aecfbfff3afddf1dd",
        "transaction_hash_low": "0xdf64ae7ef9b71c5d0e9261ef93489b2283cc819e2fa611683d08643bf1e400c2"
    }
]

Live Example

Press Try It to make a request and see what the response looks like. Feel free to try different query parameters.

Language
Click Try It! to start a request and see the response here!