Skip to main content

Token Price API — Introduction

Service overview

Service overview

The Token Price API is a multi-chain token price aggregation service. It provides these core capabilities:

  • Query supported blockchain lists and basic chain information
  • Batch real-time quotes by token ID or contract address
  • Query token asset information, including cross-chain platform distribution
  • Query fiat currency lists and exchange rates
  • Search DEX liquidity pool data

All public endpoints are mounted under the /price/api/v1 path prefix and use HTTP/JSON. The current public service does not provide WebSocket, SSE, or subscription push APIs. Public API requests must include X-API-Key, which is used for API authentication and billing.


Base URL

Use the following production host as the root path for all API requests:

https://api.gelabs.org

Example:

https://api.gelabs.org/price/api/v1/chains

Unified response shape

All endpoints use a { code, msg, data } response body. On business success, code is always 0. Common validation failures usually still return HTTP 200 and are distinguished by business error code. Internal service exceptions may return HTTP 503/500.

The response body always has this structure:

{
"code": 0,
"msg": "success",
"data": {}
}
FieldTypeDescription
codeintegerBusiness status code. Success is always 0; failures use the corresponding error code
msgstringResponse message. Usually success on success
dataobject / stringBusiness payload. On failure, this is usually an empty string ""

Successful response example:

{
"code": 0,
"msg": "success",
"data": {
"total": 1,
"items": [...]
}
}

Error response example:

{
"code": 20001,
"msg": "ids is required",
"data": ""
}

Note: Check both the HTTP status code and the response-body code. Business success is indicated by code: 0. Parameter errors are often HTTP 200 plus a business error code. Internal service failures may be HTTP 503/500.


Business error codes

CodeMeaningTypical trigger
0SuccessNormal response
20001Invalid query parameterRequired query parameter is missing or malformed
20002Invalid path parameterPath parameter is malformed or the resource was not found
20003Invalid request bodyJSON is malformed, or a required body field is missing or empty
30001Server errorInternal service error

Common request header

All public service requests must include the following header:

HeaderRequiredDescription
X-API-KeyYesAPI key used for request authentication and billing.

Some endpoints also return cache-control response headers. See the individual endpoint descriptions.