Token Price

Returns the price of a token for the specified chain

/v2/token-price

How this endpoint is to be used :

  • This endpoint can be used to show USD price of fees involved in bridging as these fees are returned in token amounts for specific token addresses in the v2/quote endpoint

Note : The token address for the native token of a given chain is 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee

Returns the price of token

GET https://api.socket.tech/v2/token-price

Path Parameters

NameTypeDescription

tokenAddress*

string

Contract address of a token

chainId*

string

ID of chain, for example ETH Mainnet is 1

{
  "success": true,
  "result": {
    "chainId": 0,
    "tokenAddress": "string",
    "tokenPrice": 0,
    "currency": "string"
  }
}

Description of response parameters

ParameterDescription

success

Indicates successful response from endpoint, as intended.

chainId

ID of chain, for example Ethereum = 1

tokenAddress

Contract address of token on the chain whose chainId is specified

tokenPrice

Price of token in specified currency

decimals

Number of decimals supported by token

currency

Currency of tokenPrice value , e.g : USD

TEST QUERY :

https://api.socket.tech/v2/swagger/#/App/AppController_getTokenPrice

Last updated