Conventions
Shared rules that apply to every REST endpoint in the API. All routes return JSON and require an API key via the x-api-key header.
Base URL
https://api.tickerlayer.com- Format
- JSON, with
Content-Type: application/json. - Timestamps
- Unix milliseconds (
number). - Methods
GETfor every data endpoint.
Authentication
| Method | Send the key as | Use |
|---|---|---|
| Header | x-api-key: <YOUR_API_KEY> | Preferred. |
| Query parameter | ?apiKey=<YOUR_API_KEY> | Compatibility fallback; keeps the key in logged URLs, so prefer the header. |
curl -sS "https://api.tickerlayer.com/crypto/quote/BTCUSD" \
-H "x-api-key: <YOUR_API_KEY>"More in the Authentication guide.
Response shape
- Null fields
- Keys stay in the schema; a value temporarily missing from the aggregated view is
null, not left out. Individual fields may be optional depending on market conditions; see each route for response details. - 404 vs empty
- A missing symbol or resource returns
404, for example{ "statusCode": 404, "message": "symbol not available" }; an empty list returns200with an empty array. - Bad parameters
400with a message that lists the valid values.
Errors & metering
The per-second limit is checked first, so a throttled request never uses monthly quota.
| Status | error | Details |
|---|---|---|
429 | REST_RATE_LIMIT_EXCEEDED | Per-second limit, with limitRps and retryAfterMs. |
429 | REST_QUOTA_EXCEEDED | Monthly quota, with limit. |
503 | USAGE_METERING_UNAVAILABLE | Usage storage is unreachable; the request fails closed. |
See Rate limits and the Errors reference.
OpenAPI, Postman & SDKs
Every REST endpoint, with its parameters, error responses and a real example response, is in one OpenAPI 3.1 file. Import it into an API client or a code generator.
https://tickerlayer.com/openapi.jsonTo send requests without writing code, open the Postman collection, paste your key into its apiKey variable and run any request.
For JavaScript and TypeScript, the tickerlayer package wraps every route above and the WebSocket stream, with typed responses and reconnects handled for you. It has no dependencies and runs on Node.js 18 and newer, Deno, Bun and in browsers.
npm install tickerlayerimport { TickerLayer } from 'tickerlayer';
const tl = new TickerLayer({ apiKey: process.env.TICKERLAYER_API_KEY });
const quote = await tl.quote('stocks', 'US:KO');For Python 3.9 and newer, the tickerlayer package has the same methods in a sync and an async client, and the stream as an async iterator.
pip install tickerlayerfrom tickerlayer import TickerLayer
tl = TickerLayer() # reads TICKERLAYER_API_KEY
quote = tl.quote("stocks", "US:KO")