Return the latest prices for up to 10,000 tokens in a single request.

Method: GET

Endpoint: https://api.syve.ai/v1/price-api/batch-latest-token-prices

🚧

Recently Added

This endpoint has been recently added. It's possible for there to still be bugs. If you find any bugs please send us a message in our Discord: https://discord.com/invite/rs5GPAZ7tG

📘

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_addressstringThis is the address or list of addresses for which to return latest price information for.

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

This is a required parameter.
price_typestringThe type of price to return in the response.

The default is price_token_usd_tick_1. All possible options for price_type are given in the table below.

📘

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.
price_token_usd_robust_total_{1h|24h}This provides the total price, in USD, based on both buy and sell trades executed in the last 1 or 24 hour(s).
price_token_usd_robust_buy_{1h|24h}This metric gives the total price, in USD, based solely on buy trades that have occurred in the last 1 or 24 hour(s).
price_token_usd_robust_sell_{1h|24}This shows the total price, in USD, accumulated from all sell trades in the last 1 or 24 hour(s).
price_token_usd_robust_mid_{1h|24h}The mid price is the average of the buy price and the sell price.

Response Fields

NameTypeDescription
block_numberintegerThe block number (i.e. height) of the event log.
timestampintegerUNIX timestamp in seconds.

The zero value corresponds to the 1st of January 1970 at UTC, called the Unix Epoch.
transaction_hashstringThe transaction has of the transaction that the DEX trade happened in.
price_usddoubleThe price of the token denominated in dollars.
price_ethdoubleThe price of the token denominated in ether.

Example: Latest tick prices 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-latest-token-prices?token_address=0xf819d9cb1c2a819fd991781a822de3ca8607c3c9,0x6982508145454ce325ddbe47a25d4ec3d2311933

Example POST Request

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

Here 0xf819d9cb1c2a819fd991781a822de3ca8607c3c9 is the address of $UNIBOT token.

Try in Postman: https://www.postman.com/dark-equinox-191074/workspace/syve-examples/request/11895150-1cfe550a-0b5a-4746-a0ee-25d37f3c7f51?ctx=documentation

Response

[
  {
    "token_address": "0x6982508145454ce325ddbe47a25d4ec3d2311933",
    "token_symbol": "PEPE",
    "token_name": "Pepe",
    "block_number": 18333929,
    "timestamp": 1697108795,
    "transaction_hash": "0x062e05f693b2f3ca00edb59f53a7cdb8c8df190771fe7f986605f7451fa7bcde",
    "price_eth": 4.054870659777217e-10,
    "price_usd": 6.261077866620348e-7
  },
  {
    "token_address": "0xf819d9cb1c2a819fd991781a822de3ca8607c3c9",
    "token_symbol": "UNIBOT",
    "token_name": "Unibot",
    "block_number": 18333885,
    "timestamp": 1697108267,
    "transaction_hash": "0x24b890f15604abd045ba46d2b619926a43eca01022af5c79de8c241b187dd16a",
    "price_eth": 0.027875131022242906,
    "price_usd": 42.988781047321275
  }
]

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!