Info Endpoint
The info endpoint provides read-only access to all public and user-specific data on GX Exchange. All requests are sent as POST /info with a JSON body containing a type field that determines which data is returned.
Endpoint
POST /info
Content-Type: application/jsonAuthentication: Not required for public queries. User-specific queries require only the user’s address (no signature).
Request Format
Every info request is a JSON object with a type field:
{ "type": "meta" }Some queries accept additional parameters:
{ "type": "l2Book", "coin": "BTC" }{ "type": "clearinghouseState", "user": "0x1234...abcd" }Available Query Types
Public Market Data
| Type | Description | Additional Fields | Details |
|---|---|---|---|
meta | Perpetual market metadata | — | Perpetuals |
spotMeta | Spot market and token metadata | — | Spot |
allMids | All current mid prices | — | Perpetuals |
l2Book | L2 orderbook snapshot | coin | Perpetuals |
candleSnapshot | Historical OHLCV candles | req: { coin, interval, startTime, endTime } | Perpetuals |
fundingHistory | Historical funding rates | coin, startTime | Perpetuals |
User-Specific Queries
| Type | Description | Additional Fields |
|---|---|---|
clearinghouseState | Account positions, margin, PnL | user |
openOrders | Active open orders | user |
userFills | Recent trade fills | user |
userFillsByTime | Fills within a time range | user, startTime, endTime, aggregateByTime |
userFees | Fee tier and history | user |
orderStatus | Status of a specific order | user, oid |
userRateLimit | Current rate limit usage | user |
portfolio | Full portfolio summary | user |
subAccounts | Sub-account listing | user |
extraAgents | Authorized API wallets | user |
referral | Referral program state | user |
delegatorSummary | Staking delegation summary | user |
Response Format
Responses vary by query type. The response body is the requested data directly — there is no wrapper object.
Example: allMids
{
"BTC": "67432.5",
"ETH": "3521.2",
"SOL": "142.8"
}Example: clearinghouseState
{
"assetPositions": [...],
"crossMarginSummary": {
"accountValue": "125000.50",
"totalMarginUsed": "12500.00",
"totalNtlPos": "50000.00",
"totalRawUsd": "75000.00"
},
"marginSummary": { ... },
"withdrawable": "112500.50"
}Rate Limits
The /info endpoint is rate-limited to 1,200 requests per minute per IP address. See Rate Limits for details.
Error Handling
Invalid query types return HTTP 400:
{
"error": "bad_request",
"message": "Unknown info type: invalidType"
}Missing required fields return HTTP 400:
{
"error": "bad_request",
"message": "Missing required field: coin"
}