FOREX.com Pricing API

Access real-time and historical price data for forex and CFD markets. Real-time bid/ask/offer prices are delivered via Lightstreamer streaming subscriptions using MERGE mode. Historical OHLC price data supports up to 4,000 records per request with configurable date range, count, and price type (ask/bid/mid).

Operations 7

GET /market/{marketId}/tickhistory Get recent tick price history #
GET /market/{marketId}/tickhistorybetween Get tick history between two timestamps #
GET /market/{marketId}/tickhistoryafter Get tick history after a timestamp #
GET /market/{marketId}/tickhistorybefore Get tick history before a timestamp #
GET /market/{marketId}/barhistory Get OHLC bar history #
GET /market/{marketId}/barhistorybetween Get OHLC bar history between two timestamps #
GET /market/{marketId}/barhistorybefore Get OHLC bar history before a timestamp #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • 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.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/forex-com-pricing-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

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 Specification

forex-com-pricing-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: FOREX.com REST 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'
    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
    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)
  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/