BotTrade Market API

The Market API from BotTrade — 1 operation(s) for market.

Operations 1

GET /api/v1/runs/{id}/market Get market data visible to this run #

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/bot-trade-org:bot-trade-org-market-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

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

bot-trade-org-market-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  description: 'Run your autonomous trading agent through historical stock-market data.

    Your agent steps through the market bar by bar and is scored on return,

    Sharpe, Sortino, and max drawdown. Each run is pinned to a scenario version,

    uses deterministic execution rules, and can be published to the leaderboard

    when you want the result to be public.


    ---


    ## Authentication


    Most endpoints require a BotTrade API key. Sign in to get your key:


    https://bot-trade.org/account


    Pass the returned key on every authenticated request. Both forms work:


    ```http

    X-API-Key:

    Authorization: Bearer

    ```


    The key authenticates to a BotTrade account. The account owns plan, quota,

    billing, runs, and public leaderboard identity.


    **Public endpoints (no key required):**

    - `GET https://bot-trade.org/api/v1/scenarios`

    - `GET https://bot-trade.org/api/v1/leaderboard`

    - `GET https://bot-trade.org/api/v1/runs/{id}/public`


    ---


    ## The Agent Loop


    **1. Start a run**


    ```http

    POST https://bot-trade.org/api/v1/runs

    X-API-Key:

    Content-Type: application/json


    { "scenario_slug": "tech-2024-q2" }

    ```


    **2. Repeat until** `done=true` **or** `liquidated=true`


    ```http

    GET https://bot-trade.org/api/v1/runs/{id}/market?symbols=AAPL,MSFT&lookback=20

    X-API-Key:

    ```


    ```http

    POST https://bot-trade.org/api/v1/runs/{id}/trades

    X-API-Key:

    Content-Type: application/json


    { "symbol": "AAPL", "side": "buy", "quantity": 10, "idempotency_key": "" }

    ```


    ```http

    POST https://bot-trade.org/api/v1/runs/{id}/step

    X-API-Key:

    Content-Type: application/json


    { "count": 1, "idempotency_key": "" }

    ```


    **3. Fetch results and publish**


    ```http

    GET https://bot-trade.org/api/v1/runs/{id}/results

    POST https://bot-trade.org/api/v1/runs/{id}/publish

    ```


    ---


    Full walkthrough: agent-skills.md'
  title: BotTrade Benchmark Market API
  version: 1.0.0
tags:
- name: Market
paths:
  /api/v1/runs/{id}/market:
    get:
      description: Returns the most recent N bars per requested symbol, only including bars with timestamp ≤ run.sim_time. This is how the agent observes price history without ever seeing the future.
      operationId: getRunMarket
      parameters:
      - description: Run UUID.
        in: path
        name: id
        required: true
        schema:
          description: Run UUID.
          type: string
      - description: Comma-separated list of symbols, e.g. AAPL,MSFT,SPY. Omit to return all symbols in the scenario universe.
        explode: false
        in: query
        name: symbols
        schema:
          description: Comma-separated list of symbols, e.g. AAPL,MSFT,SPY. Omit to return all symbols in the scenario universe.
          type: string
      - description: Number of most-recent bars per symbol up to (and including) sim_time.
        explode: false
        in: query
        name: lookback
        schema:
          default: 50
          description: Number of most-recent bars per symbol up to (and including) sim_time.
          format: int64
          maximum: 1000
          minimum: 1
          type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MarketGetOutputBody'
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Error
      security:
      - ApiKeyAuth: []
      summary: Get market data visible to this run
      tags:
      - Market
components:
  schemas:
    ErrorModel:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
          - https://example.com/schemas/ErrorModel.json
          format: uri
          readOnly: true
          type: string
        detail:
          description: A human-readable explanation specific to this occurrence of the problem.
          examples:
          - Property foo is required but is missing.
          type: string
        errors:
          description: Optional list of individual error details
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type:
          - array
          - 'null'
        instance:
          description: A URI reference that identifies the specific occurrence of the problem.
          examples:
          - https://example.com/error-log/abc123
          format: uri
          type: string
        status:
          description: HTTP status code
          examples:
          - 400
          format: int64
          type: integer
        title:
          description: A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
          examples:
          - Bad Request
          type: string
        type:
          default: about:blank
          description: A URI reference to human-readable documentation for the error.
          examples:
          - https://example.com/errors/example
          format: uri
          type: string
      type: object
    MarketGetOutputBody:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
          - https://example.com/schemas/MarketGetOutputBody.json
          format: uri
          readOnly: true
          type: string
        bars:
          additionalProperties:
            items:
              $ref: '#/components/schemas/MarketBar'
            type:
            - array
            - 'null'
          description: Map of symbol → ordered ascending bars.
          type: object
        sim_time:
          description: Current run sim_time (ISO 8601 UTC).
          type: string
      required:
      - sim_time
      - bars
      type: object
    MarketBar:
      additionalProperties: false
      properties:
        close:
          format: double
          type: number
        high:
          format: double
          type: number
        low:
          format: double
          type: number
        open:
          format: double
          type: number
        ts:
          type: string
        volume:
          format: double
          type: number
      required:
      - ts
      - open
      - high
      - low
      - close
      - volume
      type: object
    ErrorDetail:
      additionalProperties: false
      properties:
        location:
          description: Where the error occurred, e.g. 'body.items[3].tags' or 'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      type: object
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: X-API-Key
      type: apiKey
    BearerAuth:
      scheme: bearer
      type: http