Introduction
The OTC Market API provides programmatic access to real-time OTC market data. Unlike standard retail platforms that delay data by several seconds, our infrastructure connects directly to primary liquidity sources, offering a 2-candle advantage (Lead = 2).
The API supports both REST endpoints for on-demand historical or snapshot queries, and WebSocket streaming for continuous, low-latency live data. It is universally compatible with data from Quotex, Pocket Option, Expert Option, Binomo, IQ Option, and Olymp Trade.
Authentication
To maintain the highest level of security and ensure fair usage, every request to the API must be authenticated. You must include your unique API Key in the HTTP headers of every request.
You can find your API Key inside your Personal Dashboard after your subscription is verified.
Header Format
Example Request (cURL)
Security Warning: Never expose your API Key in client-side code (like browser JavaScript or mobile apps). Always route API requests through your own secure backend server to prevent unauthorized use.
Base URL & Versioning
All API endpoints are versioned to ensure your integrations do not break when we introduce new features. The current stable version is v1.
| Environment | Base URL | Purpose |
|---|---|---|
| REST API | https://api.otcmarketapi.com/v1 | For HTTP GET requests |
| WebSocket API | wss://api.otcmarketapi.com/v1/stream | For real-time streaming |
Quick Start
The fastest way to verify your API Key and see the data is to make a simple request for a real-time quote. This endpoint will return the current price of the specified pair, along with the candle lead indicator.
REST Endpoints
Use these endpoints to fetch specific data on-demand. All endpoints require the X-API-Key header and return JSON.
/v1/quote
— Real-time price quote
Fetch the latest price for a single OTC pair. This is useful for quick spot-checks or updating a single ticker in your UI without opening a WebSocket connection.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
pair | string | Yes | The OTC pair symbol (e.g., EUR/USD_OTC) |
lead | integer | No | Candle lead (defaults to 2, maximum is 2) |
Example Response
/v1/candles
— Historical + real-time candles
Retrieve OHLC (Open, High, Low, Close) data. You can use this to draw charts, run technical analysis, or backtest trading strategies. The most recent candle returned is the +2 advance candle.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
pair | string | Yes | The OTC pair symbol |
interval | string | No | Timeframe: 1m, 5m, 15m, 1h (defaults to 1m) |
limit | integer | No | Number of past candles to return (max 500) |
lead | integer | No | Candle lead (defaults to 2) |
Example Response
/v1/pairs
— List available pairs
Returns a list of all supported OTC pairs across all 6 platforms. Use this endpoint to dynamically build dropdown menus or symbol lists in your application.
Example Response
/v1/signals
— Real-time trade signals
Get real-time trading signals generated by our proprietary algorithmic engine. Each signal includes a confidence score and is based on the +2 candle advance data.
Example Response
WebSocket Streaming
For continuous real-time delivery, use our WebSocket endpoint. Unlike REST, which requires you to poll for updates, WebSocket maintains a persistent connection and pushes data to your system the instant it arrives. This is essential for high-frequency trading and live visual dashboards.
Connecting requires sending a JSON payload with your API Key, the pairs you want to subscribe to, and the stream type (candles or ticks).
wss://api.otcmarketapi.com/v1/stream
Subscription Message (Client → Server)
Rate Limits
To ensure stability and fair access for all developers, the API enforces rate limits based on your subscription tier. The X-RateLimit-Remaining header is included in every REST response so you can monitor your usage.
| Plan | API Calls | WebSocket Streams | Rate Limit |
|---|---|---|---|
| Starter | 500 / 7 days | 1 concurrent | 10 req/sec |
| Pro | 1,000 / 7 days | 3 concurrent | 50 req/sec |
| Enterprise | Unlimited | Unlimited | 200 req/sec |
Best Practices for Integration
- Use WebSockets for live charts: If your UI requires constant price updates, do not use REST polling. Use the WebSocket stream to reduce latency and save API calls.
- Cache historical data: If you need historical candles for a chart, fetch them once via REST and store them locally. Only use REST to fetch new gaps or use WebSockets for the live forming candle.
- Implement exponential backoff: If you hit a
429 (Rate Limited)error, do not spam the server. Wait a few seconds before retrying, increasing the wait time exponentially on consecutive failures. - Secure your key: Always store your API key in environment variables (e.g.,
process.env.API_KEY) and never commit it to a public GitHub repository.
Code Samples
Full working examples to help you get started quickly in the most popular programming languages.
2-Candle Advantage Explained
Every API response includes a lead field. When lead = 2, the returned data represents candle N+2, where N is the most recent candle currently displayed on standard retail platforms.
Need Help?
Full technical support and integration help is included with every plan.