DocsConventions

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.

Open .md

Base URL

Base URL
https://api.tickerlayer.com
Format
JSON, with Content-Type: application/json.
Timestamps
Unix milliseconds (number).
Methods
GET for every data endpoint.

Authentication

MethodSend the key asUse
Headerx-api-key: <YOUR_API_KEY>Preferred.
Query parameter?apiKey=<YOUR_API_KEY>Compatibility fallback; keeps the key in logged URLs, so prefer the header.
Example
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 returns 200 with an empty array.
Bad parameters
400 with a message that lists the valid values.

Errors & metering

The per-second limit is checked first, so a throttled request never uses monthly quota.

StatuserrorDetails
429REST_RATE_LIMIT_EXCEEDEDPer-second limit, with limitRps and retryAfterMs.
429REST_QUOTA_EXCEEDEDMonthly quota, with limit.
503USAGE_METERING_UNAVAILABLEUsage 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.

OpenAPI 3.1
https://tickerlayer.com/openapi.json

To 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
npm install tickerlayer
JavaScript
import { 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
pip install tickerlayer
Python
from tickerlayer import TickerLayer

tl = TickerLayer()  # reads TICKERLAYER_API_KEY
quote = tl.quote("stocks", "US:KO")