level2 Market Data API

Endpoints for retrieving historical OHLC price data for financial instruments across global exchanges.

Operations 1

GET /olhc/{api_key}/{ticker}/{timeframe}/{range} Get OHLC historical data #

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/level2-market-data-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

level2-market-data-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Level2 Strategy Builder Market Data API
  description: The Level2 Strategy Builder API provides programmatic access to market data, technical analysis, and trading strategy capabilities offered by the Level2 platform (by Bytemine Technologies Ltd.). It includes endpoints for retrieving candlestick pattern detection, ticker trend analysis, historical OHLC (Open-High-Low-Close) data, similar stock discovery, and company fundamental summaries. These endpoints power the Level2 visual no-code strategy builder used by over 50,000 traders to create, backtest, and deploy automated trading strategies without writing code.
  version: 1.0.0
  contact:
    name: Level2 Support
    url: https://www.trylevel2.com
  termsOfService: https://www.trylevel2.com/terms-and-conditions
servers:
- url: https://app.bytemine.io/api
  description: Primary API Server
- url: https://valhalla.bytemine.workers.dev
  description: Market Data Server
security:
- apiKeyPath: []
tags:
- name: Market Data
  description: Endpoints for retrieving historical OHLC price data for financial instruments across global exchanges.
paths:
  /olhc/{api_key}/{ticker}/{timeframe}/{range}:
    get:
      operationId: getOHLCData
      summary: Get OHLC historical data
      description: Retrieves historical Open-High-Low-Close (OHLC) price data for a given ticker symbol at the specified timeframe and date range. This data is used for charting, backtesting strategies, and performing technical analysis. Level2 provides access to over 200,000 stocks and financial instruments from 75 global exchanges.
      tags:
      - Market Data
      parameters:
      - $ref: '#/components/parameters/apiKey'
      - $ref: '#/components/parameters/ticker'
      - $ref: '#/components/parameters/timeframe'
      - $ref: '#/components/parameters/range'
      responses:
        '200':
          description: OHLC data retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OHLCDataResponse'
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized - invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      servers:
      - url: https://valhalla.bytemine.workers.dev
        description: Market Data Server
components:
  parameters:
    range:
      name: range
      in: path
      required: true
      description: The historical date range for OHLC data retrieval. Specifies how far back to fetch data (e.g., 1d, 5d, 1mo, 3mo, 6mo, 1y, 5y, max).
      schema:
        type: string
        enum:
        - 1d
        - 5d
        - 1mo
        - 3mo
        - 6mo
        - 1y
        - 2y
        - 5y
        - max
    ticker:
      name: ticker
      in: path
      required: true
      description: The stock ticker symbol to query (e.g., AAPL, MSFT, TSLA). Level2 supports over 200,000 instruments from 75 global exchanges.
      schema:
        type: string
        example: AAPL
    timeframe:
      name: timeframe
      in: path
      required: true
      description: The chart timeframe for the analysis or data retrieval. Common values include 1m, 5m, 15m, 30m, 1h, 4h, 1d, 1w, and 1M representing minutes, hours, days, weeks, and months respectively.
      schema:
        type: string
        enum:
        - 1m
        - 5m
        - 15m
        - 30m
        - 1h
        - 4h
        - 1d
        - 1w
        - 1M
    apiKey:
      name: api_key
      in: path
      required: true
      description: Your Level2 API key used to authenticate requests. Obtain this from your Level2 account dashboard.
      schema:
        type: string
  schemas:
    ErrorResponse:
      type: object
      description: Standard error response returned when a request fails.
      properties:
        error:
          type: string
          description: A human-readable error message describing the issue
        code:
          type: integer
          description: The HTTP status code associated with the error
    OHLCDataResponse:
      type: object
      description: Response containing historical OHLC price data for the requested ticker, timeframe, and range.
      properties:
        ticker:
          type: string
          description: The ticker symbol queried
        timeframe:
          type: string
          description: The timeframe of each candle
        data:
          type: array
          description: Array of OHLC candle data points
          items:
            $ref: '#/components/schemas/OHLCCandle'
    OHLCCandle:
      type: object
      description: A single OHLC candle data point.
      required:
      - timestamp
      - open
      - high
      - low
      - close
      properties:
        timestamp:
          type: string
          format: date-time
          description: The timestamp for this candle period
        open:
          type: number
          format: float
          description: The opening price for the period
        high:
          type: number
          format: float
          description: The highest price during the period
        low:
          type: number
          format: float
          description: The lowest price during the period
        close:
          type: number
          format: float
          description: The closing price for the period
        volume:
          type: integer
          description: The trading volume during the period
  securitySchemes:
    apiKeyPath:
      type: apiKey
      in: query
      name: api_key
      description: API key passed as a path parameter in the URL. Obtain your API key from the Level2 platform dashboard.
externalDocs:
  description: Level2 API Documentation
  url: https://guide.bytemine.io/technical-documentation/api-documentation