{
  "openapi": "3.0.1",
  "info": {
    "title": "Market Data API - Historical Tick, OHLCV, Futures, Databento",
    "description": "Historical market data from your own Databento account: tick trades, order book (MBO, MBP-10), top of book, OHLCV bars, instrument definitions and statistics for CME futures, US equities and OPRA options, plus datasets, symbology, a free cost preview and exact 1e-9 prices. Bring your own key.",
    "version": "0.1",
    "x-build-id": "InK83rY6n6nHHCWsa"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nabeelbaghoor~historical-market-data-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nabeelbaghoor-historical-market-data-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/nabeelbaghoor~historical-market-data-api/runs": {
      "post": {
        "operationId": "runs-sync-nabeelbaghoor-historical-market-data-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/nabeelbaghoor~historical-market-data-api/run-sync": {
      "post": {
        "operationId": "run-sync-nabeelbaghoor-historical-market-data-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "mode": {
            "title": "What to read",
            "enum": [
              "datasets",
              "publishers",
              "schemas",
              "fields",
              "datasetRange",
              "datasetCondition",
              "unitPrices",
              "cost",
              "records",
              "resolve"
            ],
            "type": "string",
            "description": "Datasets lists the dataset codes your key can see, with their venues, and needs nothing else, so it is the default. Market data records streams the data itself and is billed by Databento to your account; run Cost preview first, which is free on the Databento side. Resolve maps symbols to instrument IDs and back for free. The other modes list publishers, schemas, fields, the available date range, daily data condition and unit prices.",
            "default": "datasets"
          },
          "dataset": {
            "title": "Dataset",
            "type": "string",
            "description": "The dataset code, PUBLISHER.DATASET. For example GLBX.MDP3 (CME Globex futures and options), XNAS.ITCH (Nasdaq TotalView), OPRA.PILLAR (US equity options), EQUS.MINI (US equities mini), DBEQ.BASIC, XNYS.PILLAR, IFEU.IMPACT (ICE Europe), XEUR.EOBI (Eurex). The datasets mode lists the ones your key sees."
          },
          "symbols": {
            "title": "Symbols",
            "type": "array",
            "description": "Cost preview, records and resolve. Up to 2,000 symbols in the input symbology type, one per line, such as ESM2, AAPL, ES.FUT or ES.c.0. ALL_SYMBOLS selects every instrument in the dataset, which can be large and costly.",
            "items": {
              "type": "string"
            }
          },
          "schema": {
            "title": "Schema",
            "enum": [
              "trades",
              "mbo",
              "mbp-1",
              "mbp-10",
              "tbbo",
              "bbo-1s",
              "bbo-1m",
              "ohlcv-1s",
              "ohlcv-1m",
              "ohlcv-1h",
              "ohlcv-1d",
              "definition",
              "statistics",
              "status",
              "imbalance"
            ],
            "type": "string",
            "description": "Records, cost preview and fields. The record format to read. Not every dataset carries every schema; the schemas mode lists a dataset's own.",
            "default": "trades"
          },
          "start": {
            "title": "Start",
            "type": "string",
            "description": "Inclusive start, as YYYY-MM-DD (midnight UTC), an ISO 8601 date-time such as 2022-06-06T14:30 (UTC unless a zone is given) or UNIX nanoseconds. Records filter on ts_recv where the schema has it. Datasets, condition and resolve use the date part."
          },
          "end": {
            "title": "End",
            "type": "string",
            "description": "Exclusive end, in the same forms. Leave empty to let Databento forward fill it from the start's resolution."
          },
          "stypeIn": {
            "title": "Input symbology type",
            "enum": [
              "raw_symbol",
              "instrument_id",
              "parent",
              "continuous"
            ],
            "type": "string",
            "description": "How the symbols are written.",
            "default": "raw_symbol"
          },
          "stypeOut": {
            "title": "Output symbology type",
            "enum": [
              "raw_symbol",
              "instrument_id",
              "parent",
              "continuous"
            ],
            "type": "string",
            "description": "Records and resolve. The symbology to map to; must be a valid combination with the input type (raw symbol to instrument ID is the usual one).",
            "default": "instrument_id"
          },
          "fieldsEncoding": {
            "title": "Field list encoding",
            "enum": [
              "json",
              "csv",
              "dbn"
            ],
            "type": "string",
            "description": "Fields mode. The encoding whose fields to list. JSON matches what the records mode returns.",
            "default": "json"
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "The most rows this run returns and charges for. In the records mode it is sent as the documented limit, so Databento stops sending, and billing, at this many records.",
            "default": 100
          },
          "maxCostUsd": {
            "title": "Maximum Databento cost (USD)",
            "minimum": 0,
            "maximum": 100000,
            "type": "number",
            "description": "Records mode. Before streaming, the actor asks Databento for the cost of the request (free) and stops without streaming if it is above this many US dollars. Databento bills the data to your own account. Set 0 to turn the check off.",
            "default": 1
          },
          "apiKey": {
            "title": "API key",
            "type": "string",
            "description": "Your own Databento API key, from the API keys page of the Databento portal (32 characters, starting with db-). Stored as a secret. You can instead set the DATA_API_KEY environment secret."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}