Get started
Gel Labs public APIs cover prices, transfer monitoring, RPC, and TRON energy rental. Fastest path: create an App in Console, copy the API Key, send your first request.
Get an API Key
- Open Console and sign in with a wallet.
- Create an App.
- Copy the API Key from the App page. Keep it on the server. Do not ship it in a browser or mobile app.
export API_KEY="your-api-key"
Sending TRX to rent energy, and the public quote GET|POST /energy-rental/trx-quote, do not need a key; see Energy rental. RPC authenticates with the endpoint token in the path, not X-API-Key.
Base URL
HTTPS https://gateway.gelabs.org
WSS wss://gateway.gelabs.org
Authentication
Most HTTP APIs take one header:
X-API-Key: your-api-key
| Product | Auth |
|---|---|
| Price, transfers, energy rental API | X-API-Key |
| RPC | {token} in the URL; do not send X-API-Key |
Send your first request
Verify the key with a price call (1 = BTC, 1027 = ETH):
curl -H "X-API-Key: $API_KEY" \
"https://gateway.gelabs.org/market/api/v1/quotes/latest?ids=1,1027"
On success code is 0 and quotes are in data.items.
Response format
Except RPC (upstream JSON-RPC), HTTP success looks like:
{
"code": 0,
"message": "success",
"data": {}
}
| Field | Type | Meaning |
|---|---|---|
code | integer | Business code. Success is always 0 |
message | string | Text. Often success or ok |
data | object / array / string / null | Payload. Failures are usually "" or null |
Treat code === 0 as success. Do not rely on HTTP status alone. The field name is message, not msg.
Products
| Product | What it does | Entry |
|---|---|---|
| Token price | Live quotes by token id or contract | /market/api/v1 |
| Transfers | Watch addresses, history, live push | /tx/api/v1, /tx/ws |
| RPC | JSON-RPC HTTP / WebSocket | /rpc/{network}/{token} |
| Energy rental | Rent 1 hour of TRON energy: send TRX or call the API | /energy-rental |
Pick a product and open its Quick start.