openapi: 3.1.0 info: title: Polygon Crypto REST Aggregates DailyBars API version: '1.0' description: 'Polygon Crypto API exposes aggregated cross-exchange data for crypto pairs (e.g., X:BTCUSD) via `https://api.polygon.io`. This spec covers aggregates, daily open/close, snapshots, and level-2 books. Auth uses an API key via `apiKey` query parameter or `Authorization: Bearer`. ' contact: name: Polygon Documentation url: https://polygon.io/docs/crypto servers: - url: https://api.polygon.io description: Polygon REST API security: - apiKeyQuery: [] - bearerAuth: [] tags: - name: DailyBars description: Daily open/close. paths: /v1/open-close/crypto/{from}/{to}/{date}: get: tags: - DailyBars operationId: getCryptoDailyOpenClose summary: Get Daily Open Close For A Crypto Pair description: Get the open/close prices on a specific date for a crypto pair. parameters: - in: path name: from required: true schema: type: string - in: path name: to required: true schema: type: string - in: path name: date required: true schema: type: string format: date responses: '200': description: Crypto daily open/close response content: application/json: schema: $ref: '#/components/schemas/CryptoDailyOpenCloseResponse' /v1/open-close/{stocksTicker}/{date}: get: tags: - DailyBars operationId: getStocksDailyOpenClose summary: Get Daily Open Close For A Stock Ticker description: Returns the open, close, high, and low for a stock ticker on a specific date. parameters: - in: path name: stocksTicker required: true schema: type: string - in: path name: date required: true schema: type: string format: date - in: query name: adjusted schema: type: boolean default: true responses: '200': description: Daily open/close response content: application/json: schema: $ref: '#/components/schemas/DailyOpenCloseResponse' /v2/aggs/grouped/locale/us/market/stocks/{date}: get: tags: - DailyBars operationId: getStocksGroupedDailyBars summary: Get Grouped Daily Bars For US Stocks description: Returns daily aggregate bars for all US stock tickers on a specific date. parameters: - in: path name: date required: true schema: type: string format: date - in: query name: adjusted schema: type: boolean default: true - in: query name: include_otc schema: type: boolean default: false responses: '200': description: Grouped daily bars response content: application/json: schema: $ref: '#/components/schemas/AggregatesResponse' /v2/aggs/ticker/{stocksTicker}/prev: get: tags: - DailyBars operationId: getStocksPreviousClose summary: Get Previous Close For A Stock Ticker description: Returns the previous trading day's open, close, high, and low for a stock ticker. parameters: - in: path name: stocksTicker required: true schema: type: string - in: query name: adjusted schema: type: boolean default: true responses: '200': description: Previous close response content: application/json: schema: $ref: '#/components/schemas/AggregatesResponse' components: schemas: AggregatesResponse: type: object properties: ticker: type: string adjusted: type: boolean queryCount: type: integer resultsCount: type: integer status: type: string request_id: type: string count: type: integer next_url: type: string format: uri results: type: array items: $ref: '#/components/schemas/AggregateBar' DailyOpenCloseResponse: type: object properties: status: type: string from: type: string format: date symbol: type: string open: type: number high: type: number low: type: number close: type: number volume: type: number afterHours: type: number preMarket: type: number AggregateBar: type: object properties: T: type: string description: Ticker symbol (only present on certain endpoints). v: type: number description: Trading volume. vw: type: number description: Volume-weighted average price. o: type: number description: Open price. c: type: number description: Close price. h: type: number description: High price. l: type: number description: Low price. t: type: integer format: int64 description: Unix millisecond timestamp. n: type: integer description: Number of transactions. CryptoDailyOpenCloseResponse: type: object properties: status: type: string symbol: type: string isUTC: type: boolean day: type: string format: date open: type: number close: type: number openTrades: type: array items: type: object additionalProperties: true closingTrades: type: array items: type: object additionalProperties: true securitySchemes: apiKeyQuery: type: apiKey in: query name: apiKey bearerAuth: type: http scheme: bearer bearerFormat: API Key