FOREX.com Pricing API
Real-time tick history and OHLC bar history
Real-time tick history and OHLC bar history
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/forex-com-pricing-api"
curl "https://apis.io/api/v1/apis?limit=25"
Discovery needs no key. Ratings and market analysis are Pro.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: FOREX.com REST Account Pricing API
description: The FOREX.com REST API, hosted at ciapi.cityindex.com/TradingAPI, enables algorithmic traders to authenticate sessions, retrieve real-time and historical price data, execute buy/sell orders across 80+ forex and CFD markets, and manage account balances, positions, and order history programmatically. Authentication uses a session-based header credential obtained from the /session endpoint. A separate FIX API is available for institutional clients.
version: 1.0.0
contact:
name: FOREX.com API Support
url: https://www.forex.com/en/help-and-support/
email: support.en@forex.com
termsOfService: https://www.forex.com/en-us/help-and-support/pricing-and-fees/
x-api-id: forex-com-trading-api
x-logo:
url: https://www.forex.com/favicon.ico
servers:
- url: https://ciapi.cityindex.com/TradingAPI
description: FOREX.com REST API Base URL
security:
- SessionAuth: []
UserNameAuth: []
tags:
- name: Pricing
description: Real-time tick history and OHLC bar history
paths:
/market/{marketId}/tickhistory:
get:
operationId: getTickHistory
summary: Get recent tick price history
description: Retrieve recent tick price history for a given market. Returns bid, ask, and mid prices for the most recent ticks. Maximum 4,000 records per request.
tags:
- Pricing
parameters:
- name: marketId
in: path
required: true
description: Market ID for the instrument
schema:
type: integer
example: 400616380
- name: PriceTicks
in: query
required: false
description: Number of price ticks to return (max 4000)
schema:
type: integer
maximum: 4000
default: 1
example: 100
- name: priceType
in: query
required: false
description: Price type to return
schema:
type: string
enum:
- MID
- BID
- ASK
default: MID
responses:
'200':
description: Tick price history retrieved
content:
application/json:
schema:
$ref: '#/components/schemas/TickHistoryResponse'
/market/{marketId}/tickhistorybetween:
get:
operationId: getTickHistoryBetween
summary: Get tick history between two timestamps
description: Retrieve tick price history for a market between two UTC timestamps.
tags:
- Pricing
parameters:
- name: marketId
in: path
required: true
description: Market ID for the instrument
schema:
type: integer
- name: fromTimeStampUTC
in: query
required: true
description: Start timestamp in UTC (Unix epoch milliseconds)
schema:
type: integer
format: int64
- name: toTimestampUTC
in: query
required: true
description: End timestamp in UTC (Unix epoch milliseconds)
schema:
type: integer
format: int64
- name: priceType
in: query
required: false
description: Price type to return
schema:
type: string
enum:
- MID
- BID
- ASK
default: MID
responses:
'200':
description: Tick price history between timestamps
content:
application/json:
schema:
$ref: '#/components/schemas/TickHistoryResponse'
/market/{marketId}/tickhistoryafter:
get:
operationId: getTickHistoryAfter
summary: Get tick history after a timestamp
description: Retrieve a number of tick price records after a given UTC timestamp.
tags:
- Pricing
parameters:
- name: marketId
in: path
required: true
description: Market ID for the instrument
schema:
type: integer
- name: maxResults
in: query
required: true
description: Maximum number of results to return (max 4000)
schema:
type: integer
maximum: 4000
- name: fromTimeStampUTC
in: query
required: true
description: Start timestamp in UTC (Unix epoch milliseconds)
schema:
type: integer
format: int64
- name: priceType
in: query
required: false
description: Price type to return
schema:
type: string
enum:
- MID
- BID
- ASK
default: MID
responses:
'200':
description: Tick price history after timestamp
content:
application/json:
schema:
$ref: '#/components/schemas/TickHistoryResponse'
/market/{marketId}/tickhistorybefore:
get:
operationId: getTickHistoryBefore
summary: Get tick history before a timestamp
description: Retrieve a number of tick price records before a given UTC timestamp.
tags:
- Pricing
parameters:
- name: marketId
in: path
required: true
description: Market ID for the instrument
schema:
type: integer
- name: maxResults
in: query
required: true
description: Maximum number of results to return (max 4000)
schema:
type: integer
maximum: 4000
- name: toTimeStampUTC
in: query
required: true
description: End timestamp in UTC (Unix epoch milliseconds)
schema:
type: integer
format: int64
- name: priceType
in: query
required: false
description: Price type to return
schema:
type: string
enum:
- MID
- BID
- ASK
default: MID
responses:
'200':
description: Tick price history before timestamp
content:
application/json:
schema:
$ref: '#/components/schemas/TickHistoryResponse'
/market/{marketId}/barhistory:
get:
operationId: getBarHistory
summary: Get OHLC bar history
description: Retrieve open, high, low, close (OHLC) price bar history for a market. Supports MINUTE, HOUR, and DAY intervals with configurable span.
tags:
- Pricing
parameters:
- name: marketId
in: path
required: true
description: Market ID for the instrument
schema:
type: integer
- name: interval
in: query
required: true
description: Bar interval type
schema:
type: string
enum:
- MINUTE
- HOUR
- DAY
- name: span
in: query
required: true
description: Interval span (e.g. 1 for 1-hour bars, 15 for 15-minute bars)
schema:
type: integer
- name: PriceBars
in: query
required: false
description: Number of price bars to return (max 4000)
schema:
type: integer
maximum: 4000
default: 1
responses:
'200':
description: OHLC bar history retrieved
content:
application/json:
schema:
$ref: '#/components/schemas/BarHistoryResponse'
/market/{marketId}/barhistorybetween:
get:
operationId: getBarHistoryBetween
summary: Get OHLC bar history between two timestamps
description: Retrieve OHLC price bars for a market between two UTC timestamps.
tags:
- Pricing
parameters:
- name: marketId
in: path
required: true
description: Market ID for the instrument
schema:
type: integer
- name: interval
in: query
required: true
description: Bar interval type
schema:
type: string
enum:
- MINUTE
- HOUR
- DAY
- name: span
in: query
required: true
description: Interval span
schema:
type: integer
- name: fromTimeStampUTC
in: query
required: true
description: Start timestamp in UTC (Unix epoch milliseconds)
schema:
type: integer
format: int64
- name: toTimestampUTC
in: query
required: true
description: End timestamp in UTC (Unix epoch milliseconds)
schema:
type: integer
format: int64
responses:
'200':
description: OHLC bar history between timestamps
content:
application/json:
schema:
$ref: '#/components/schemas/BarHistoryResponse'
/market/{marketId}/barhistorybefore:
get:
operationId: getBarHistoryBefore
summary: Get OHLC bar history before a timestamp
description: Retrieve a number of OHLC bar records before a given UTC timestamp.
tags:
- Pricing
parameters:
- name: marketId
in: path
required: true
description: Market ID for the instrument
schema:
type: integer
- name: interval
in: query
required: true
description: Bar interval type
schema:
type: string
enum:
- MINUTE
- HOUR
- DAY
- name: span
in: query
required: true
description: Interval span
schema:
type: integer
- name: maxResults
in: query
required: true
description: Maximum number of results to return (max 4000)
schema:
type: integer
maximum: 4000
- name: toTimeStampUTC
in: query
required: true
description: End timestamp in UTC (Unix epoch milliseconds)
schema:
type: integer
format: int64
responses:
'200':
description: OHLC bar history before timestamp
content:
application/json:
schema:
$ref: '#/components/schemas/BarHistoryResponse'
components:
schemas:
BarHistoryResponse:
type: object
properties:
PriceBars:
type: array
items:
$ref: '#/components/schemas/PriceBar'
PriceBar:
type: object
properties:
BarDate:
type: string
description: Bar date in /Date(milliseconds)/ format
Open:
type: number
format: double
description: Opening price
High:
type: number
format: double
description: High price
Low:
type: number
format: double
description: Low price
Close:
type: number
format: double
description: Closing price
Volume:
type: number
format: double
description: Volume (if available)
TickHistoryResponse:
type: object
properties:
PriceTicks:
type: array
items:
$ref: '#/components/schemas/PriceTick'
PriceTick:
type: object
properties:
Price:
type: number
format: double
description: Tick price value
TickDate:
type: string
description: Tick date in /Date(milliseconds)/ format
securitySchemes:
SessionAuth:
type: apiKey
in: header
name: Session
description: Session ID obtained from POST /session
UserNameAuth:
type: apiKey
in: header
name: UserName
description: FOREX.com account username
externalDocs:
description: FOREX.com API Trading Documentation
url: https://www.forex.com/en/trading-tools/api-trading/