🪙Token Price

Endpoint

GET /v1/tokens/price?tokenId=<TOKEN_IDs>

Description

This endpoint returns the USD price for a given token or a comma separated list of tokenId's. The tokenId parameter is required and should be a string in the format <TOKEN_CONTRACT_ADDRESS>:<NETWORK_ID>. The TOKEN_CONTRACT_ADDRESS is the address of the token contract on the specified network, and the NETWORK_ID is the ID of the network the token is on. See supported networks for more info.

Query String Parameters

  • tokenId (required): A string in the format <TOKEN_CONTRACT_ADDRESS>:<NETWORK_ID> that identifies the token to look up.

Headers

  • x-api-key (required): A valid API key.

Example

curl -X GET 'https://api.lynxcrypto.app/v1/tokens/price?tokenId=0x52ec25e58a9e144ff002625bb2aa58cc6da24cb2:56,0x9813037ee2218799597d83d4a5b6f3b6778218d9:1'
-H 'x-api-key: <YOUR_API_KEY>'

Response

If querying for one tokenId you will be returned a single object.

{
        "contract": "0x52ec25e58a9e144ff002625bb2aa58cc6da24cb2",
        "chain": "56",
        "name": "arcadekingdoms",
        "symbol": "ack",
        "usd_price": 0.0017911779847393145,
        "price_change": -1.883584096628293
 }

If querying for a list of tokens you will be returned an array of objects.

[
    {
        "contract": "0x52ec25e58a9e144ff002625bb2aa58cc6da24cb2",
        "chain": "56",
        "name": "arcadekingdoms",
        "symbol": "ack",
        "usd_price": 0.0017911779847393145,
        "price_change": -1.883584096628293
    },
    {
        "contract": "0x9813037ee2218799597d83d4a5b6f3b6778218d9",
        "chain": "1",
        "name": "bone shibaswap",
        "symbol": "bone",
        "usd_price": 1.5358275681156723,
        "price_change": 10.671730513280767
    }
]

Response Codes

  • 200: Success. Returns the USD price for the given token.

  • 400: Bad Request. The tokenId query string parameter is not provided.

  • 403: Forbidden. The x-api-key header is not provided or is invalid.

  • 404: Not Found. The token_id is not found in the tokens collection.

Last updated