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": {}
}
| Field | Type | Description |
|---|---|---|
code | integer | Business status code. Success is always 0; failures use the corresponding error code |
msg | string | Response message. Usually success on success |
data | object / string | Business 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 bycode: 0. Parameter errors are often HTTP 200 plus a business error code. Internal service failures may be HTTP 503/500.
Business error codes
| Code | Meaning | Typical trigger |
|---|---|---|
0 | Success | Normal response |
20001 | Invalid query parameter | Required query parameter is missing or malformed |
20002 | Invalid path parameter | Path parameter is malformed or the resource was not found |
20003 | Invalid request body | JSON is malformed, or a required body field is missing or empty |
30001 | Server error | Internal service error |
Common request header
All public service requests must include the following header:
| Header | Required | Description |
|---|---|---|
X-API-Key | Yes | API key used for request authentication and billing. |
Some endpoints also return cache-control response headers. See the individual endpoint descriptions.