{
  "openapi": "3.0.1",
  "info": {
    "title": "Stock Market Data API - Bars, Options, Crypto, Forex (Massive)",
    "description": "Stock market data API for US stocks, options, indices, forex and crypto via Massive (formerly Polygon.io): OHLC bars, trades, quotes, snapshots, options chains with greeks, news, dividends, splits, financials, ratios and technical indicators. Bring your own key.",
    "version": "0.1",
    "x-build-id": "7GvikXQD0ze3pHEVK"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nabeelbaghoor~stock-market-data-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nabeelbaghoor-stock-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~stock-market-data-api/runs": {
      "post": {
        "operationId": "runs-sync-nabeelbaghoor-stock-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~stock-market-data-api/run-sync": {
      "post": {
        "operationId": "run-sync-nabeelbaghoor-stock-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": [
              "aggregates",
              "previousClose",
              "groupedDaily",
              "dailyOpenClose",
              "trades",
              "quotes",
              "lastTrade",
              "lastQuote",
              "snapshot",
              "marketSnapshot",
              "movers",
              "optionsChain",
              "indicesSnapshot",
              "tickers",
              "tickerDetails",
              "relatedCompanies",
              "optionsContracts",
              "news",
              "dividends",
              "splits",
              "ipos",
              "incomeStatements",
              "balanceSheets",
              "cashFlowStatements",
              "ratios",
              "shortInterest",
              "shortVolume",
              "indicators",
              "treasuryYields",
              "currencyConversion",
              "exchanges",
              "marketStatus",
              "marketHolidays"
            ],
            "type": "string",
            "description": "Each choice is one documented Massive REST route. Custom bars (the default) returns OHLC, volume and VWAP bars for the tickers and dates below. The modes marked per ticker make one request per ticker; the others read the whole market or a filtered list.",
            "default": "aggregates"
          },
          "tickers": {
            "title": "Tickers",
            "type": "array",
            "description": "Tickers as the provider writes them: AAPL or BRK.B for stocks, X:BTCUSD for crypto, C:EURUSD for forex, I:SPX for indices, O:AAPL251219C00150000 for an option contract. Required by the per-ticker modes (bars, trades, quotes, snapshots of one ticker, details, indicators; the options chain takes the underlying stock). Optional filter elsewhere.",
            "items": {
              "type": "string"
            }
          },
          "dateFrom": {
            "title": "Date start",
            "type": "string",
            "description": "Start of the range, inclusive, as YYYY-MM-DD or an ISO 8601 date-time. Bars (defaults to 30 days before the end), trades, quotes, news, dividends (ex-date), splits, IPOs (listing date), financial statements (period end), short interest and volume, indicators and Treasury yields."
          },
          "dateTo": {
            "title": "Date end",
            "type": "string",
            "description": "End of the range, inclusive, as YYYY-MM-DD or an ISO 8601 date-time. Bars default to today."
          },
          "date": {
            "title": "Date",
            "type": "string",
            "description": "One day as YYYY-MM-DD. Daily market summary and daily open and close (default: the most recent weekday before today); the as-of date for ticker search, ticker overview and options contracts."
          },
          "multiplier": {
            "title": "Bar size",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Custom bars. How many timespans make one bar: 5 with minute gives 5-minute bars.",
            "default": 1
          },
          "timespan": {
            "title": "Timespan",
            "enum": [
              "second",
              "minute",
              "hour",
              "day",
              "week",
              "month",
              "quarter",
              "year"
            ],
            "type": "string",
            "description": "Custom bars and indicators. The unit of one bar (second is for bars only).",
            "default": "day"
          },
          "adjusted": {
            "title": "Adjust for splits",
            "type": "boolean",
            "description": "Bars, daily summaries and indicators. Leave on for split-adjusted prices.",
            "default": true
          },
          "sortOrder": {
            "title": "Sort order",
            "enum": [
              "asc",
              "desc"
            ],
            "type": "string",
            "description": "Oldest first or newest first, on the date the mode lists by. Left empty, bars, ticker lists, snapshots, options and ratios list in ascending order and every dated list (trades, quotes, news, dividends, splits, IPOs, statements, short data, indicators, yields) lists newest first."
          },
          "market": {
            "title": "Market",
            "enum": [
              "stocks",
              "crypto",
              "fx",
              "otc",
              "indices"
            ],
            "type": "string",
            "description": "Daily market summary, full market snapshot and top movers: stocks, crypto or forex. Ticker search also takes OTC and indices.",
            "default": "stocks"
          },
          "includeOtc": {
            "title": "Include OTC",
            "type": "boolean",
            "description": "Stocks only: include OTC securities in the daily summary, full market snapshot and movers.",
            "default": false
          },
          "direction": {
            "title": "Movers direction",
            "enum": [
              "gainers",
              "losers"
            ],
            "type": "string",
            "description": "Top movers: the top 20 gainers or losers of the day.",
            "default": "gainers"
          },
          "assetClass": {
            "title": "Asset class",
            "enum": [
              "stocks",
              "options",
              "crypto",
              "fx",
              "indices"
            ],
            "type": "string",
            "description": "Unified snapshot: snapshot a whole asset class when no tickers are set. Exchanges: list the exchanges of one asset class (indices is not offered there)."
          },
          "search": {
            "title": "Search",
            "type": "string",
            "description": "Ticker search: terms matched against ticker and company name, such as apple."
          },
          "tickerType": {
            "title": "Ticker type",
            "enum": [
              "CS",
              "ADRC",
              "ADRP",
              "ADRR",
              "UNIT",
              "RIGHT",
              "PFD",
              "FUND",
              "SP",
              "WARRANT",
              "INDEX",
              "ETF",
              "ETN",
              "OS",
              "GDR",
              "OTHER",
              "NYRS",
              "AGEN",
              "EQLK",
              "BOND",
              "ADRW",
              "BASKET",
              "LT"
            ],
            "type": "string",
            "description": "Ticker search: keep one security type."
          },
          "tickerStatus": {
            "title": "Ticker status",
            "enum": [
              "active",
              "delisted"
            ],
            "type": "string",
            "description": "Ticker search: actively traded tickers, or delisted ones.",
            "default": "active"
          },
          "contractType": {
            "title": "Contract type",
            "enum": [
              "call",
              "put"
            ],
            "type": "string",
            "description": "Options chain and options contracts: calls or puts. Leave empty for both."
          },
          "expirationFrom": {
            "title": "Expiration from",
            "type": "string",
            "description": "Options: earliest expiration date, YYYY-MM-DD."
          },
          "expirationTo": {
            "title": "Expiration to",
            "type": "string",
            "description": "Options: latest expiration date, YYYY-MM-DD."
          },
          "strikeMin": {
            "title": "Minimum strike",
            "minimum": 0,
            "type": "number",
            "description": "Options: lowest strike price."
          },
          "strikeMax": {
            "title": "Maximum strike",
            "minimum": 0,
            "type": "number",
            "description": "Options: highest strike price."
          },
          "expired": {
            "title": "Expired contracts",
            "type": "boolean",
            "description": "Options contracts: list expired contracts instead of live ones.",
            "default": false
          },
          "distributionType": {
            "title": "Dividend type",
            "enum": [
              "recurring",
              "special",
              "supplemental",
              "irregular",
              "unknown"
            ],
            "type": "string",
            "description": "Dividends: keep one distribution type."
          },
          "adjustmentType": {
            "title": "Split type",
            "enum": [
              "forward_split",
              "reverse_split",
              "stock_dividend"
            ],
            "type": "string",
            "description": "Splits: keep one adjustment type."
          },
          "ipoStatus": {
            "title": "IPO status",
            "enum": [
              "pending",
              "new",
              "history",
              "rumor",
              "postponed",
              "withdrawn",
              "direct_listing_process"
            ],
            "type": "string",
            "description": "IPOs: keep one status."
          },
          "timeframe": {
            "title": "Reporting period",
            "enum": [
              "quarterly",
              "annual",
              "trailing_twelve_months"
            ],
            "type": "string",
            "description": "Financial statements: quarterly, annual or trailing twelve months (balance sheets have no trailing twelve months)."
          },
          "fiscalYear": {
            "title": "Fiscal year",
            "minimum": 1900,
            "maximum": 2100,
            "type": "integer",
            "description": "Financial statements: one fiscal year, such as 2025."
          },
          "indicator": {
            "title": "Indicator",
            "enum": [
              "sma",
              "ema",
              "rsi",
              "macd"
            ],
            "type": "string",
            "description": "Technical indicator mode.",
            "default": "sma"
          },
          "window": {
            "title": "Window",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "SMA, EMA and RSI: the window size in timespans (provider default 50 for SMA and EMA, 14 for RSI)."
          },
          "seriesType": {
            "title": "Price series",
            "enum": [
              "close",
              "open",
              "high",
              "low"
            ],
            "type": "string",
            "description": "Indicators: which price the indicator is computed on.",
            "default": "close"
          },
          "shortWindow": {
            "title": "MACD short window",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "MACD only (provider default 12)."
          },
          "longWindow": {
            "title": "MACD long window",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "MACD only (provider default 26)."
          },
          "signalWindow": {
            "title": "MACD signal window",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "MACD only (provider default 9)."
          },
          "currencyFrom": {
            "title": "Convert from",
            "type": "string",
            "description": "Currency conversion: the currency to convert from, such as USD or BTC."
          },
          "currencyTo": {
            "title": "Convert to",
            "type": "string",
            "description": "Currency conversion: the currency to convert to, such as EUR."
          },
          "amount": {
            "title": "Amount",
            "minimum": 0,
            "type": "number",
            "description": "Currency conversion: the amount to convert.",
            "default": 1
          },
          "precision": {
            "title": "Decimal places",
            "minimum": 0,
            "maximum": 4,
            "type": "integer",
            "description": "Currency conversion: decimal places in the result, 0 to 4.",
            "default": 2
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "The most rows this run returns and charges for. Lists are followed page by page (up to 50,000 rows a page for bars, trades and quotes) until they end or this cap is hit.",
            "default": 500
          },
          "requestsPerMinute": {
            "title": "Requests per minute",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Pacing. The free Massive plan allows 5 calls a minute; paid plans have no fixed cap, so raise this to 100 or more on a paid key.",
            "default": 5
          },
          "apiKey": {
            "title": "API key",
            "type": "string",
            "description": "Your own Massive API key, from the Keys page of the Massive dashboard (a free plan exists; Polygon.io keys carry over). Stored as a secret and sent only in the Authorization header. 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}