From 2ab8cdb0b8e4947b72979e68f787f746ac7de7f6 Mon Sep 17 00:00:00 2001 From: Cameron Yick Date: Sat, 13 Dec 2025 23:43:54 -0500 Subject: [PATCH 1/2] feat: Add OpenAPI foundation components MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add core OpenAPI 3.0.0 infrastructure for Tiingo API: - Main openapi.yaml with API structure and routing - Common schemas (Date, DateTime, Ticker, Currency, ErrorResponse) - Reusable parameters (token, ticker, date ranges, formats) - Standard error responses (401, 404, 500) - Schema and component registries This foundation enables all endpoint-specific specifications. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .beads/issues.jsonl | 22 ++++ openapi/openapi.yaml | 179 +++++++++++++++++++++++++++++++++ openapi/parameters/_index.yaml | 49 +++++++++ openapi/responses/_index.yaml | 34 +++++++ openapi/schemas/_index.yaml | 168 +++++++++++++++++++++++++++++++ openapi/schemas/common.yaml | 39 +++++++ 6 files changed, 491 insertions(+) create mode 100644 .beads/issues.jsonl create mode 100644 openapi/openapi.yaml create mode 100644 openapi/parameters/_index.yaml create mode 100644 openapi/responses/_index.yaml create mode 100644 openapi/schemas/_index.yaml create mode 100644 openapi/schemas/common.yaml diff --git a/.beads/issues.jsonl b/.beads/issues.jsonl new file mode 100644 index 0000000..58eb94d --- /dev/null +++ b/.beads/issues.jsonl @@ -0,0 +1,22 @@ +{"id":"tiingo-python-3ra","title":"Create main openapi.yaml index file","description":"Create openapi/openapi.yaml main index file with $ref references to all 9 path files, common components (parameters, schemas, responses), servers config, and security schemes","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-13T18:14:16.246571-05:00","updated_at":"2025-12-13T21:12:36.8245-05:00","closed_at":"2025-12-13T21:12:36.8245-05:00","dependencies":[{"issue_id":"tiingo-python-3ra","depends_on_id":"tiingo-python-3ui","type":"blocks","created_at":"2025-12-13T18:33:53.94051-05:00","created_by":"daemon"}]} +{"id":"tiingo-python-3ui","title":"Create schemas index file","description":"Create openapi/schemas/_index.yaml that references all schema files: common.yaml, eod-schemas.yaml, news-schemas.yaml, crypto-schemas.yaml, forex-schemas.yaml, iex-schemas.yaml, fundamentals-schemas.yaml, funds-schemas.yaml, dividends-schemas.yaml, splits-schemas.yaml","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-13T18:14:17.925327-05:00","updated_at":"2025-12-13T20:12:10.346339-05:00","closed_at":"2025-12-13T20:12:10.346339-05:00","dependencies":[{"issue_id":"tiingo-python-3ui","depends_on_id":"tiingo-python-db3","type":"blocks","created_at":"2025-12-13T18:33:53.617742-05:00","created_by":"daemon"},{"issue_id":"tiingo-python-3ui","depends_on_id":"tiingo-python-hv6","type":"blocks","created_at":"2025-12-13T18:33:53.647897-05:00","created_by":"daemon"},{"issue_id":"tiingo-python-3ui","depends_on_id":"tiingo-python-qui","type":"blocks","created_at":"2025-12-13T18:33:53.6761-05:00","created_by":"daemon"},{"issue_id":"tiingo-python-3ui","depends_on_id":"tiingo-python-8g5","type":"blocks","created_at":"2025-12-13T18:33:53.704791-05:00","created_by":"daemon"},{"issue_id":"tiingo-python-3ui","depends_on_id":"tiingo-python-r9g","type":"blocks","created_at":"2025-12-13T18:33:53.733829-05:00","created_by":"daemon"},{"issue_id":"tiingo-python-3ui","depends_on_id":"tiingo-python-zxc","type":"blocks","created_at":"2025-12-13T18:33:53.763228-05:00","created_by":"daemon"},{"issue_id":"tiingo-python-3ui","depends_on_id":"tiingo-python-b3u","type":"blocks","created_at":"2025-12-13T18:33:53.795726-05:00","created_by":"daemon"},{"issue_id":"tiingo-python-3ui","depends_on_id":"tiingo-python-j56","type":"blocks","created_at":"2025-12-13T18:33:53.827326-05:00","created_by":"daemon"},{"issue_id":"tiingo-python-3ui","depends_on_id":"tiingo-python-yfj","type":"blocks","created_at":"2025-12-13T18:33:53.857293-05:00","created_by":"daemon"}]} +{"id":"tiingo-python-4bk","title":"task","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-13T18:14:16.391477-05:00","updated_at":"2025-12-13T18:14:16.391477-05:00"} +{"id":"tiingo-python-5bx","title":"task","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-13T18:14:16.48674-05:00","updated_at":"2025-12-13T18:14:16.48674-05:00"} +{"id":"tiingo-python-8g5","title":"Generate OpenAPI spec for Forex endpoints","description":"Read docs/api_extracted/forex.md and create openapi/paths/forex.yaml and openapi/schemas/forex-schemas.yaml. Include endpoints: /tiingo/fx/{ticker}, /tiingo/fx/top, /tiingo/fx/{ticker}/prices. Schemas: ForexTopOfBook, ForexPrice","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-13T18:14:22.828837-05:00","updated_at":"2025-12-13T19:39:23.801863-05:00","closed_at":"2025-12-13T19:39:23.801863-05:00","dependencies":[{"issue_id":"tiingo-python-8g5","depends_on_id":"tiingo-python-gco","type":"blocks","created_at":"2025-12-13T18:33:44.295421-05:00","created_by":"daemon"},{"issue_id":"tiingo-python-8g5","depends_on_id":"tiingo-python-jyg","type":"blocks","created_at":"2025-12-13T18:33:44.335832-05:00","created_by":"daemon"},{"issue_id":"tiingo-python-8g5","depends_on_id":"tiingo-python-oy5","type":"blocks","created_at":"2025-12-13T18:33:44.362837-05:00","created_by":"daemon"}]} +{"id":"tiingo-python-aeb","title":"Validate complete OpenAPI specification","description":"Run OpenAPI validation tools to ensure all $ref references resolve correctly, all schemas are valid, and the specification passes OpenAPI 3.0.3 validation. Fix any issues found.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-13T18:14:19.12959-05:00","updated_at":"2025-12-13T22:30:08.827714-05:00","closed_at":"2025-12-13T22:30:08.827714-05:00","dependencies":[{"issue_id":"tiingo-python-aeb","depends_on_id":"tiingo-python-3ra","type":"blocks","created_at":"2025-12-13T18:33:54.021641-05:00","created_by":"daemon"}]} +{"id":"tiingo-python-b3u","title":"Generate OpenAPI spec for Mutual Fund/ETF Fees endpoints","description":"Read docs/api_extracted/mutual-fund-etf-fees.md and create openapi/paths/funds.yaml and openapi/schemas/funds-schemas.yaml. Include endpoints: /tiingo/funds/{ticker}, /tiingo/funds/{ticker}/metrics. Schemas: FundOverview, FundMetrics","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-13T18:14:16.299961-05:00","updated_at":"2025-12-13T19:39:23.803006-05:00","closed_at":"2025-12-13T19:39:23.803006-05:00","dependencies":[{"issue_id":"tiingo-python-b3u","depends_on_id":"tiingo-python-gco","type":"blocks","created_at":"2025-12-13T18:33:45.465575-05:00","created_by":"daemon"},{"issue_id":"tiingo-python-b3u","depends_on_id":"tiingo-python-jyg","type":"blocks","created_at":"2025-12-13T18:33:45.503921-05:00","created_by":"daemon"},{"issue_id":"tiingo-python-b3u","depends_on_id":"tiingo-python-oy5","type":"blocks","created_at":"2025-12-13T18:33:45.536194-05:00","created_by":"daemon"}]} +{"id":"tiingo-python-db3","title":"Generate OpenAPI spec for End-of-Day endpoints","description":"Read docs/api_extracted/end-of-day.md and create openapi/paths/end-of-day.yaml and openapi/schemas/eod-schemas.yaml. Include endpoints: /tiingo/daily/{ticker}/prices, /tiingo/daily/{ticker}. Schemas: PriceData, TickerMetadata","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-13T18:14:16.300561-05:00","updated_at":"2025-12-13T19:39:23.799437-05:00","closed_at":"2025-12-13T19:39:23.799437-05:00","dependencies":[{"issue_id":"tiingo-python-db3","depends_on_id":"tiingo-python-gco","type":"blocks","created_at":"2025-12-13T18:33:43.019056-05:00","created_by":"daemon"},{"issue_id":"tiingo-python-db3","depends_on_id":"tiingo-python-jyg","type":"blocks","created_at":"2025-12-13T18:33:43.048754-05:00","created_by":"daemon"},{"issue_id":"tiingo-python-db3","depends_on_id":"tiingo-python-oy5","type":"blocks","created_at":"2025-12-13T18:33:43.087225-05:00","created_by":"daemon"}]} +{"id":"tiingo-python-gco","title":"Create common OpenAPI parameters file","description":"Create openapi/parameters/_index.yaml with reusable parameters: TokenParam, TickerPathParam, StartDateParam, EndDateParam, FormatParam","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-13T18:14:24.019038-05:00","updated_at":"2025-12-13T19:10:56.633329-05:00","closed_at":"2025-12-13T19:10:56.633329-05:00"} +{"id":"tiingo-python-hv6","title":"Generate OpenAPI spec for News endpoints","description":"Read docs/api_extracted/news.md and create openapi/paths/news.yaml and openapi/schemas/news-schemas.yaml. Include endpoints: /tiingo/news, /tiingo/news/bulk_download, /tiingo/news/bulk_download/{id}. Schemas: NewsArticle, BulkDownloadFile","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-13T18:14:16.43936-05:00","updated_at":"2025-12-13T19:39:23.800886-05:00","closed_at":"2025-12-13T19:39:23.800886-05:00","dependencies":[{"issue_id":"tiingo-python-hv6","depends_on_id":"tiingo-python-gco","type":"blocks","created_at":"2025-12-13T18:33:43.51446-05:00","created_by":"daemon"},{"issue_id":"tiingo-python-hv6","depends_on_id":"tiingo-python-jyg","type":"blocks","created_at":"2025-12-13T18:33:43.547333-05:00","created_by":"daemon"},{"issue_id":"tiingo-python-hv6","depends_on_id":"tiingo-python-oy5","type":"blocks","created_at":"2025-12-13T18:33:43.577716-05:00","created_by":"daemon"}]} +{"id":"tiingo-python-j56","title":"Generate OpenAPI spec for Dividends endpoints","description":"Read docs/api_extracted/dividends.md and create openapi/paths/dividends.yaml and openapi/schemas/dividends-schemas.yaml. Include endpoints: /tiingo/corporate-actions/distributions, /tiingo/corporate-actions/{ticker}/distributions, /tiingo/corporate-actions/{ticker}/distribution-yield. Schemas: Distribution, DistributionYield","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-13T18:14:16.537928-05:00","updated_at":"2025-12-13T19:39:23.803357-05:00","closed_at":"2025-12-13T19:39:23.803357-05:00","dependencies":[{"issue_id":"tiingo-python-j56","depends_on_id":"tiingo-python-gco","type":"blocks","created_at":"2025-12-13T18:33:45.916691-05:00","created_by":"daemon"},{"issue_id":"tiingo-python-j56","depends_on_id":"tiingo-python-jyg","type":"blocks","created_at":"2025-12-13T18:33:45.949027-05:00","created_by":"daemon"},{"issue_id":"tiingo-python-j56","depends_on_id":"tiingo-python-oy5","type":"blocks","created_at":"2025-12-13T18:33:45.979509-05:00","created_by":"daemon"}]} +{"id":"tiingo-python-jyg","title":"Create common OpenAPI responses file","description":"Create openapi/responses/_index.yaml with standard error responses (400, 401, 404, 429, 500) using ErrorResponse schema","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-13T18:14:24.102764-05:00","updated_at":"2025-12-13T19:10:56.634733-05:00","closed_at":"2025-12-13T19:10:56.634733-05:00"} +{"id":"tiingo-python-kf1","title":"task","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-13T18:14:16.295251-05:00","updated_at":"2025-12-13T18:14:16.295251-05:00"} +{"id":"tiingo-python-oy5","title":"Create common OpenAPI schemas file","description":"Create openapi/schemas/common.yaml with reusable schemas: Date (YYYY-MM-DD), DateTime (ISO 8601), Ticker (string pattern), Currency, ErrorResponse","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-13T18:14:24.186823-05:00","updated_at":"2025-12-13T19:10:56.635466-05:00","closed_at":"2025-12-13T19:10:56.635466-05:00"} +{"id":"tiingo-python-qui","title":"Generate OpenAPI spec for Crypto endpoints","description":"Read docs/api_extracted/crypto.md and create openapi/paths/crypto.yaml and openapi/schemas/crypto-schemas.yaml. Include endpoints: /tiingo/crypto/prices, /tiingo/crypto, /tiingo/crypto/top (deprecated). Schemas: CryptoPrice, CryptoMetadata, CryptoTopOfBook","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-13T18:14:16.611042-05:00","updated_at":"2025-12-13T19:39:23.801412-05:00","closed_at":"2025-12-13T19:39:23.801412-05:00","dependencies":[{"issue_id":"tiingo-python-qui","depends_on_id":"tiingo-python-gco","type":"blocks","created_at":"2025-12-13T18:33:43.878154-05:00","created_by":"daemon"},{"issue_id":"tiingo-python-qui","depends_on_id":"tiingo-python-jyg","type":"blocks","created_at":"2025-12-13T18:33:43.906201-05:00","created_by":"daemon"},{"issue_id":"tiingo-python-qui","depends_on_id":"tiingo-python-oy5","type":"blocks","created_at":"2025-12-13T18:33:43.935488-05:00","created_by":"daemon"}]} +{"id":"tiingo-python-r9g","title":"Generate OpenAPI spec for IEX endpoints","description":"Read docs/api_extracted/iex.md and create openapi/paths/iex.yaml and openapi/schemas/iex-schemas.yaml. Include endpoints: /iex, /iex/{ticker}, /iex/{ticker}/prices. Schemas: IEXTopOfBook, IEXPrice","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-13T18:14:22.930732-05:00","updated_at":"2025-12-13T19:39:23.802213-05:00","closed_at":"2025-12-13T19:39:23.802213-05:00","dependencies":[{"issue_id":"tiingo-python-r9g","depends_on_id":"tiingo-python-gco","type":"blocks","created_at":"2025-12-13T18:33:44.661321-05:00","created_by":"daemon"},{"issue_id":"tiingo-python-r9g","depends_on_id":"tiingo-python-jyg","type":"blocks","created_at":"2025-12-13T18:33:44.692337-05:00","created_by":"daemon"},{"issue_id":"tiingo-python-r9g","depends_on_id":"tiingo-python-oy5","type":"blocks","created_at":"2025-12-13T18:33:44.72001-05:00","created_by":"daemon"}]} +{"id":"tiingo-python-rse","title":"task","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-13T18:14:16.64347-05:00","updated_at":"2025-12-13T18:14:16.64347-05:00"} +{"id":"tiingo-python-tsp","title":"task","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-13T18:14:16.300538-05:00","updated_at":"2025-12-13T18:14:16.300538-05:00"} +{"id":"tiingo-python-wm4","title":"task","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-13T18:14:16.759112-05:00","updated_at":"2025-12-13T18:14:16.759112-05:00"} +{"id":"tiingo-python-y7a","title":"Generate modular OpenAPI 3.0 specification for Tiingo API","description":"Create a complete, modular OpenAPI 3.0.3 specification for all 9 Tiingo REST API endpoint categories. The spec will use a maintainable file structure with separate files for paths, schemas, parameters, and responses, all referenced via the main openapi.yaml index file.","status":"closed","priority":2,"issue_type":"epic","created_at":"2025-12-13T18:14:33.229701-05:00","updated_at":"2025-12-13T22:38:59.777612-05:00","closed_at":"2025-12-13T22:38:59.777612-05:00"} +{"id":"tiingo-python-yfj","title":"Generate OpenAPI spec for Splits endpoints","description":"Read docs/api_extracted/splits.md and create openapi/paths/splits.yaml and openapi/schemas/splits-schemas.yaml. Include endpoints: /tiingo/corporate-actions/splits, /tiingo/corporate-actions/{ticker}/splits. Schemas: Split","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-13T18:14:16.708985-05:00","updated_at":"2025-12-13T19:39:23.80368-05:00","closed_at":"2025-12-13T19:39:23.80368-05:00","dependencies":[{"issue_id":"tiingo-python-yfj","depends_on_id":"tiingo-python-gco","type":"blocks","created_at":"2025-12-13T18:33:46.383795-05:00","created_by":"daemon"},{"issue_id":"tiingo-python-yfj","depends_on_id":"tiingo-python-jyg","type":"blocks","created_at":"2025-12-13T18:33:46.412601-05:00","created_by":"daemon"},{"issue_id":"tiingo-python-yfj","depends_on_id":"tiingo-python-oy5","type":"blocks","created_at":"2025-12-13T18:33:46.441969-05:00","created_by":"daemon"}]} +{"id":"tiingo-python-zxc","title":"Generate OpenAPI spec for Fundamentals endpoints","description":"Read docs/api_extracted/fundamentals.md and create openapi/paths/fundamentals.yaml and openapi/schemas/fundamentals-schemas.yaml. Include endpoints: /tiingo/fundamentals/definitions, /tiingo/fundamentals/{ticker}/statements, /tiingo/fundamentals/{ticker}/daily, /tiingo/fundamentals/meta. Schemas: FundamentalDefinition, FinancialStatement, DailyMetric, FundamentalMeta","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-13T18:14:23.024124-05:00","updated_at":"2025-12-13T19:39:23.802546-05:00","closed_at":"2025-12-13T19:39:23.802546-05:00","dependencies":[{"issue_id":"tiingo-python-zxc","depends_on_id":"tiingo-python-gco","type":"blocks","created_at":"2025-12-13T18:33:45.098824-05:00","created_by":"daemon"},{"issue_id":"tiingo-python-zxc","depends_on_id":"tiingo-python-jyg","type":"blocks","created_at":"2025-12-13T18:33:45.138032-05:00","created_by":"daemon"},{"issue_id":"tiingo-python-zxc","depends_on_id":"tiingo-python-oy5","type":"blocks","created_at":"2025-12-13T18:33:45.176957-05:00","created_by":"daemon"}]} diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml new file mode 100644 index 0000000..3d947b7 --- /dev/null +++ b/openapi/openapi.yaml @@ -0,0 +1,179 @@ +openapi: 3.0.3 + +info: + title: Tiingo REST API + version: 1.0.0 + description: | + Tiingo is a financial data platform providing real-time and historical market data. + + This API provides access to: + - End-of-Day stock prices and metadata + - Financial news articles and bulk downloads + - Cryptocurrency prices and metadata + - Foreign exchange (Forex) rates and prices + - IEX real-time stock data + - Fundamental financial statements and metrics + - Mutual fund and ETF data + - Corporate actions (dividends and stock splits) + + Authentication is required via API token. Get your free API token at https://www.tiingo.com + contact: + name: Tiingo API Support + url: https://www.tiingo.com + email: api@tiingo.com + license: + name: Tiingo Terms of Service + url: https://www.tiingo.com/about/terms-of-service + +servers: + - url: https://api.tiingo.com + description: Production API Server + - url: https://apimedia.tiingo.com + description: Media/Static Assets Server + +# Global security requirement - all endpoints require API key +security: + - ApiKeyAuth: [] + +# ============================================================================ +# PATHS - API Endpoints +# ============================================================================ +paths: + # -------------------------------------------------------------------------- + # End-of-Day Endpoints (2 endpoints) + # -------------------------------------------------------------------------- + /tiingo/daily/{ticker}/prices: + $ref: "./paths/end-of-day.yaml#/daily-prices" + + /tiingo/daily/{ticker}: + $ref: "./paths/end-of-day.yaml#/daily-meta" + + # -------------------------------------------------------------------------- + # News Endpoints (3 endpoints) + # -------------------------------------------------------------------------- + /tiingo/news: + $ref: "./paths/news.yaml#/news" + + /tiingo/news/bulk_download: + $ref: "./paths/news.yaml#/bulk-list" + + /tiingo/news/bulk_download/{id}: + $ref: "./paths/news.yaml#/bulk-download" + + # -------------------------------------------------------------------------- + # Crypto Endpoints (3 endpoints) + # -------------------------------------------------------------------------- + /tiingo/crypto/prices: + $ref: "./paths/crypto.yaml#/crypto-prices" + + /tiingo/crypto: + $ref: "./paths/crypto.yaml#/crypto-meta" + + /tiingo/crypto/top: + $ref: "./paths/crypto.yaml#/crypto-top" + + # -------------------------------------------------------------------------- + # Forex Endpoints (3 endpoints) + # -------------------------------------------------------------------------- + /tiingo/fx/{ticker}: + $ref: "./paths/forex.yaml#/forex-single" + + /tiingo/fx/top: + $ref: "./paths/forex.yaml#/forex-top" + + /tiingo/fx/{ticker}/prices: + $ref: "./paths/forex.yaml#/forex-prices" + + # -------------------------------------------------------------------------- + # IEX Endpoints (3 endpoints) + # -------------------------------------------------------------------------- + /iex: + $ref: "./paths/iex.yaml#/iex-all" + + /iex/{ticker}: + $ref: "./paths/iex.yaml#/iex-single" + + /iex/{ticker}/prices: + $ref: "./paths/iex.yaml#/iex-prices" + + # -------------------------------------------------------------------------- + # Fundamentals Endpoints (4 endpoints) + # -------------------------------------------------------------------------- + /tiingo/fundamentals/definitions: + $ref: "./paths/fundamentals.yaml#/definitions" + + /tiingo/fundamentals/{ticker}/statements: + $ref: "./paths/fundamentals.yaml#/statements" + + /tiingo/fundamentals/{ticker}/daily: + $ref: "./paths/fundamentals.yaml#/daily" + + /tiingo/fundamentals/meta: + $ref: "./paths/fundamentals.yaml#/meta" + + # -------------------------------------------------------------------------- + # Funds Endpoints (2 endpoints) + # -------------------------------------------------------------------------- + /tiingo/funds/{ticker}: + $ref: "./paths/funds.yaml#/fund-overview" + + /tiingo/funds/{ticker}/metrics: + $ref: "./paths/funds.yaml#/fund-metrics" + + # -------------------------------------------------------------------------- + # Dividends/Distributions Endpoints (3 endpoints) + # -------------------------------------------------------------------------- + /tiingo/corporate-actions/distributions: + $ref: "./paths/dividends.yaml#/distributions-batch" + + /tiingo/corporate-actions/{ticker}/distributions: + $ref: "./paths/dividends.yaml#/distributions-ticker" + + /tiingo/corporate-actions/{ticker}/distribution-yield: + $ref: "./paths/dividends.yaml#/distribution-yield" + + # -------------------------------------------------------------------------- + # Splits Endpoints (2 endpoints) + # -------------------------------------------------------------------------- + /tiingo/corporate-actions/splits: + $ref: "./paths/splits.yaml#/splits-batch" + + /tiingo/corporate-actions/{ticker}/splits: + $ref: "./paths/splits.yaml#/splits-ticker" + +# ============================================================================ +# COMPONENTS - Reusable definitions +# ============================================================================ +components: + # -------------------------------------------------------------------------- + # Security Schemes + # -------------------------------------------------------------------------- + securitySchemes: + ApiKeyAuth: + type: apiKey + in: query + name: token + description: | + API key authentication. Obtain your API token from https://www.tiingo.com + + Usage: Add `?token=YOUR_API_TOKEN` to all API requests. + + Example: `https://api.tiingo.com/tiingo/daily/aapl/prices?token=YOUR_API_TOKEN` + + # -------------------------------------------------------------------------- + # Reusable Parameters + # -------------------------------------------------------------------------- + parameters: + $ref: "./parameters/_index.yaml" + + # -------------------------------------------------------------------------- + # Reusable Schemas + # -------------------------------------------------------------------------- + schemas: + $ref: "./schemas/_index.yaml" + + # -------------------------------------------------------------------------- + # Reusable Responses + # -------------------------------------------------------------------------- + responses: + $ref: "./responses/_index.yaml" diff --git a/openapi/parameters/_index.yaml b/openapi/parameters/_index.yaml new file mode 100644 index 0000000..fa7c144 --- /dev/null +++ b/openapi/parameters/_index.yaml @@ -0,0 +1,49 @@ +# Reusable Parameter Definitions for Tiingo API +# Reference these using: $ref: '../parameters/_index.yaml#/ParameterName' + +TokenParam: &TokenParam + name: token + in: query + required: true + schema: + type: string + description: API token for authentication + +TickerPathParam: &TickerPathParam + name: ticker + in: path + required: true + schema: + type: string + pattern: '^[A-Z0-9]{1,5}$' + description: Stock or cryptocurrency ticker symbol + +StartDateParam: &StartDateParam + name: startDate + in: query + required: false + schema: + type: string + format: date + description: Start date for historical data in YYYY-MM-DD format + +EndDateParam: &EndDateParam + name: endDate + in: query + required: false + schema: + type: string + format: date + description: End date for historical data in YYYY-MM-DD format + +FormatParam: &FormatParam + name: format + in: query + required: false + schema: + type: string + enum: + - json + - csv + default: json + description: Response format (json or csv) diff --git a/openapi/responses/_index.yaml b/openapi/responses/_index.yaml new file mode 100644 index 0000000..7bb652b --- /dev/null +++ b/openapi/responses/_index.yaml @@ -0,0 +1,34 @@ +BadRequest: &BadRequest + description: Bad Request - Invalid parameters + content: + application/json: + schema: + $ref: '../schemas/common.yaml#/ErrorResponse' + +Unauthorized: &Unauthorized + description: Unauthorized - Invalid or missing API token + content: + application/json: + schema: + $ref: '../schemas/common.yaml#/ErrorResponse' + +NotFound: &NotFound + description: Not Found - Ticker or resource not found + content: + application/json: + schema: + $ref: '../schemas/common.yaml#/ErrorResponse' + +TooManyRequests: &TooManyRequests + description: Too Many Requests - Rate limit exceeded + content: + application/json: + schema: + $ref: '../schemas/common.yaml#/ErrorResponse' + +InternalServerError: &InternalServerError + description: Internal Server Error + content: + application/json: + schema: + $ref: '../schemas/common.yaml#/ErrorResponse' diff --git a/openapi/schemas/_index.yaml b/openapi/schemas/_index.yaml new file mode 100644 index 0000000..2742ec8 --- /dev/null +++ b/openapi/schemas/_index.yaml @@ -0,0 +1,168 @@ +# OpenAPI Schemas Index +# This file provides a centralized index of all schema components across the Tiingo API +# organized by endpoint category. Each schema is defined with a YAML anchor and references +# the actual schema definition from its respective file. + +# ======================================================================== +# COMMON SCHEMAS - Shared across all endpoints +# Reference: ./common.yaml +# ======================================================================== + +Date: &Date + $ref: './common.yaml#/Date' + +DateTime: &DateTime + $ref: './common.yaml#/DateTime' + +Ticker: &Ticker + $ref: './common.yaml#/Ticker' + +Currency: &Currency + $ref: './common.yaml#/Currency' + +ErrorResponse: &ErrorResponse + $ref: './common.yaml#/ErrorResponse' + +# ======================================================================== +# END-OF-DAY STOCK PRICE SCHEMAS +# Reference: https://www.tiingo.com/documentation/end-of-day +# File: ./eod-schemas.yaml +# ======================================================================== + +PriceData: &PriceData + $ref: './eod-schemas.yaml#/PriceData' + +TickerMetadata: &TickerMetadata + $ref: './eod-schemas.yaml#/TickerMetadata' + +# ======================================================================== +# NEWS API SCHEMAS +# File: ./news-schemas.yaml +# ======================================================================== + +NewsArticle: &NewsArticle + $ref: './news-schemas.yaml#/NewsArticle' + +BulkDownloadFile: &BulkDownloadFile + $ref: './news-schemas.yaml#/BulkDownloadFile' + +# ======================================================================== +# CRYPTOCURRENCY API SCHEMAS +# File: ./crypto-schemas.yaml +# ======================================================================== + +CryptoCurrency: &CryptoCurrency + $ref: './crypto-schemas.yaml#/CryptoCurrency' + +CryptoTicker: &CryptoTicker + $ref: './crypto-schemas.yaml#/CryptoTicker' + +ResampleFreq: &ResampleFreq + $ref: './crypto-schemas.yaml#/ResampleFreq' + +PriceDataItem: &PriceDataItem + $ref: './crypto-schemas.yaml#/PriceDataItem' + +ExchangeDataItem: &ExchangeDataItem + $ref: './crypto-schemas.yaml#/ExchangeDataItem' + +CryptoPrice: &CryptoPrice + $ref: './crypto-schemas.yaml#/CryptoPrice' + +CryptoMetadata: &CryptoMetadata + $ref: './crypto-schemas.yaml#/CryptoMetadata' + +TopOfBookData: &TopOfBookData + $ref: './crypto-schemas.yaml#/TopOfBookData' + +TopOfBookExchangeData: &TopOfBookExchangeData + $ref: './crypto-schemas.yaml#/TopOfBookExchangeData' + +CryptoTopOfBook: &CryptoTopOfBook + $ref: './crypto-schemas.yaml#/CryptoTopOfBook' + +# ======================================================================== +# FOREX API SCHEMAS +# File: ./forex-schemas.yaml +# ======================================================================== + +ForexTopOfBook: &ForexTopOfBook + $ref: './forex-schemas.yaml#/ForexTopOfBook' + +ForexPrice: &ForexPrice + $ref: './forex-schemas.yaml#/ForexPrice' + +# ======================================================================== +# IEX EXCHANGE API SCHEMAS +# Reference: https://api.tiingo.com/documentation/iex +# File: ./iex-schemas.yaml +# ======================================================================== + +IEXTopOfBook: &IEXTopOfBook + $ref: './iex-schemas.yaml#/IEXTopOfBook' + +IEXPrice: &IEXPrice + $ref: './iex-schemas.yaml#/IEXPrice' + +# ======================================================================== +# FUNDAMENTALS API SCHEMAS +# File: ./fundamentals-schemas.yaml +# ======================================================================== + +FundamentalDefinition: &FundamentalDefinition + $ref: './fundamentals-schemas.yaml#/FundamentalDefinition' + +DataPoint: &DataPoint + $ref: './fundamentals-schemas.yaml#/DataPoint' + +StatementData: &StatementData + $ref: './fundamentals-schemas.yaml#/StatementData' + +FinancialStatement: &FinancialStatement + $ref: './fundamentals-schemas.yaml#/FinancialStatement' + +DailyMetric: &DailyMetric + $ref: './fundamentals-schemas.yaml#/DailyMetric' + +FundamentalMeta: &FundamentalMeta + $ref: './fundamentals-schemas.yaml#/FundamentalMeta' + +# ======================================================================== +# MUTUAL FUNDS AND ETF SCHEMAS +# Reference: /docs/api_extracted/mutual-fund-etf-fees.md +# File: ./funds-schemas.yaml +# ======================================================================== + +OtherShareClass: &OtherShareClass + $ref: './funds-schemas.yaml#/OtherShareClass' + +FundOverview: &FundOverview + $ref: './funds-schemas.yaml#/FundOverview' + +CustomFee: &CustomFee + $ref: './funds-schemas.yaml#/CustomFee' + +FundMetrics: &FundMetrics + $ref: './funds-schemas.yaml#/FundMetrics' + +# ======================================================================== +# DIVIDENDS AND DISTRIBUTIONS SCHEMAS +# File: ./dividends-schemas.yaml +# ======================================================================== + +Distribution: &Distribution + $ref: './dividends-schemas.yaml#/Distribution' + +DistributionYield: &DistributionYield + $ref: './dividends-schemas.yaml#/DistributionYield' + +# ======================================================================== +# STOCK SPLITS SCHEMAS +# File: ./splits-schemas.yaml +# ======================================================================== + +Split: &Split + $ref: './splits-schemas.yaml#/Split' + +SplitArray: &SplitArray + $ref: './splits-schemas.yaml#/SplitArray' diff --git a/openapi/schemas/common.yaml b/openapi/schemas/common.yaml new file mode 100644 index 0000000..5bdaf49 --- /dev/null +++ b/openapi/schemas/common.yaml @@ -0,0 +1,39 @@ +Date: &Date + type: string + format: date + pattern: '^\d{4}-\d{2}-\d{2}$' + description: Date in ISO 8601 format + example: '2025-12-13' + +DateTime: &DateTime + type: string + format: date-time + description: Timestamp in ISO 8601 format + example: '2025-12-13T18:00:00.000Z' + +Ticker: &Ticker + type: string + pattern: '^[A-Z0-9]+$' + description: Stock, ETF, or crypto ticker symbol + example: 'AAPL' + +Currency: &Currency + type: string + pattern: '^[A-Z]{3}$' + description: ISO 4217 currency code + example: 'USD' + +ErrorResponse: &ErrorResponse + type: object + properties: + error: + type: string + description: Error message + detail: + type: string + description: Detailed error information + required: + - error + example: + error: "Invalid ticker symbol" + detail: "Ticker 'XYZ123' not found" From 5a42e329cb40c34f50f807ef3fa97f2d230fae3e Mon Sep 17 00:00:00 2001 From: Cameron Yick Date: Sat, 13 Dec 2025 23:30:11 -0500 Subject: [PATCH 2/2] feat: Add stock market endpoints (EOD, IEX, News) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add OpenAPI specifications for stock market data: - End-of-day prices with metadata - IEX real-time prices, quotes, and historical data - News articles with tags and sources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- openapi/paths/end-of-day.yaml | 191 +++++++++++++++++++++ openapi/paths/iex.yaml | 269 ++++++++++++++++++++++++++++++ openapi/paths/news.yaml | 212 +++++++++++++++++++++++ openapi/schemas/eod-schemas.yaml | 119 +++++++++++++ openapi/schemas/iex-schemas.yaml | 220 ++++++++++++++++++++++++ openapi/schemas/news-schemas.yaml | 114 +++++++++++++ 6 files changed, 1125 insertions(+) create mode 100644 openapi/paths/end-of-day.yaml create mode 100644 openapi/paths/iex.yaml create mode 100644 openapi/paths/news.yaml create mode 100644 openapi/schemas/eod-schemas.yaml create mode 100644 openapi/schemas/iex-schemas.yaml create mode 100644 openapi/schemas/news-schemas.yaml diff --git a/openapi/paths/end-of-day.yaml b/openapi/paths/end-of-day.yaml new file mode 100644 index 0000000..c618a45 --- /dev/null +++ b/openapi/paths/end-of-day.yaml @@ -0,0 +1,191 @@ +# End-of-Day Stock Price API Paths +# Reference: https://www.tiingo.com/documentation/end-of-day + +daily-prices: &daily-prices + get: + summary: Get End-of-Day Stock Prices + description: | + Returns End-of-Day price data for a given stock ticker. + + Tiingo's End-of-Day prices use a proprietary error checking framework to help clean data feeds + and catch missing corporate actions (splits, dividends, and exchange listing changes). + + **Pricing Availability:** + - Most US Equity prices are available at 5:30 PM EST + - Exchanges may send corrections until 8 PM EST + - Mutual Fund NAVs available after 12 AM EST + + **Price Adjustments:** + - Both raw and adjusted prices are available + - Adjustment methodology follows CRSP (Center for Research in Security Prices) standard + - Incorporates both split and dividend adjustments + operationId: getEndOfDayPrices + tags: + - End-of-Day + parameters: + - $ref: '../parameters/_index.yaml#/TickerPathParam' + - $ref: '../parameters/_index.yaml#/TokenParam' + - $ref: '../parameters/_index.yaml#/StartDateParam' + - $ref: '../parameters/_index.yaml#/EndDateParam' + - $ref: '../parameters/_index.yaml#/FormatParam' + - name: resampleFreq + in: query + required: false + schema: + type: string + enum: + - daily + - weekly + - monthly + - annually + - 1min + - 5min + - 15min + - 30min + - 1hour + - 4hour + description: Resample frequency for OHLC bars (e.g., daily, monthly, weekly, 5min, 1hour) + - name: sort + in: query + required: false + schema: + type: string + enum: + - asc + - desc + default: asc + description: Sort order for results (ascending or descending by date) + - name: columns + in: query + required: false + schema: + type: string + description: Comma-separated list of specific columns to return (e.g., "date,close,volume") + example: "date,close,volume" + responses: + '200': + description: Successful response with price data + content: + application/json: + schema: + $ref: '../schemas/eod-schemas.yaml#/PriceData' + examples: + singleDay: + summary: Single day price data + value: + - date: "2024-01-01" + open: 150.25 + high: 152.50 + low: 149.75 + close: 151.80 + volume: 50000000 + adjOpen: 150.25 + adjHigh: 152.50 + adjLow: 149.75 + adjClose: 151.80 + adjVolume: 50000000 + divCash: 0.0 + splitFactor: 1.0 + historicalData: + summary: Multiple days historical data + value: + - date: "2024-01-01" + open: 150.25 + high: 152.50 + low: 149.75 + close: 151.80 + volume: 50000000 + adjOpen: 150.25 + adjHigh: 152.50 + adjLow: 149.75 + adjClose: 151.80 + adjVolume: 50000000 + divCash: 0.0 + splitFactor: 1.0 + - date: "2024-01-02" + open: 151.90 + high: 153.20 + low: 151.50 + close: 152.40 + volume: 48000000 + adjOpen: 151.90 + adjHigh: 153.20 + adjLow: 151.50 + adjClose: 152.40 + adjVolume: 48000000 + divCash: 0.0 + splitFactor: 1.0 + text/csv: + schema: + type: string + format: binary + example: | + date,open,high,low,close,volume,adjOpen,adjHigh,adjLow,adjClose,adjVolume,divCash,splitFactor + 2024-01-01,150.25,152.50,149.75,151.80,50000000,150.25,152.50,149.75,151.80,50000000,0.0,1.0 + '400': + $ref: '../responses/_index.yaml#/BadRequest' + '401': + $ref: '../responses/_index.yaml#/Unauthorized' + '404': + $ref: '../responses/_index.yaml#/NotFound' + '429': + $ref: '../responses/_index.yaml#/TooManyRequests' + '500': + $ref: '../responses/_index.yaml#/InternalServerError' + +daily-meta: &daily-meta + get: + summary: Get Stock Ticker Metadata + description: | + Returns metadata information about a specific stock ticker. + + Meta information comes from a variety of sources and is used to help communicate + details about an asset in the Tiingo database to users. + + **Response Fields:** + - Ticker symbol and full name + - Exchange where the asset is listed + - Description of the company/asset + - Date range for available price data + operationId: getTickerMetadata + tags: + - End-of-Day + parameters: + - $ref: '../parameters/_index.yaml#/TickerPathParam' + - $ref: '../parameters/_index.yaml#/TokenParam' + responses: + '200': + description: Successful response with ticker metadata + content: + application/json: + schema: + $ref: '../schemas/eod-schemas.yaml#/TickerMetadata' + examples: + appleMetadata: + summary: Apple Inc metadata + value: + ticker: "AAPL" + name: "Apple Inc" + exchangeCode: "NASDAQ" + description: "Apple Inc is an American multinational technology company that specializes in consumer electronics, software and online services." + startDate: "1990-01-01" + endDate: "2024-01-01" + noDataTicker: + summary: Ticker with no price data + value: + ticker: "NEWCO" + name: "New Company Inc" + exchangeCode: "NYSE" + description: "A newly listed company" + startDate: null + endDate: null + '400': + $ref: '../responses/_index.yaml#/BadRequest' + '401': + $ref: '../responses/_index.yaml#/Unauthorized' + '404': + $ref: '../responses/_index.yaml#/NotFound' + '429': + $ref: '../responses/_index.yaml#/TooManyRequests' + '500': + $ref: '../responses/_index.yaml#/InternalServerError' diff --git a/openapi/paths/iex.yaml b/openapi/paths/iex.yaml new file mode 100644 index 0000000..582c858 --- /dev/null +++ b/openapi/paths/iex.yaml @@ -0,0 +1,269 @@ +# IEX Exchange API Endpoints +# Reference: https://api.tiingo.com/documentation/iex + +iex-all: &iex-all + get: + summary: Get current top-of-book and last price for all or multiple tickers + description: | + Retrieve current top-of-book (bid/ask) and last price data for all available tickers or a specified list of tickers. + Returns real-time reference prices or full TOPS feed data (requires IEX Exchange registration). + + This endpoint provides: + - Top-of-Book (Bid/Ask) data + - Last Sale (trade) data + - Tiingo-enriched convenience fields (tngoLast, mid, open, high, low) + - Volume data (IEX only during trading, all exchanges after close) + operationId: getAllIEXQuotes + tags: + - IEX + parameters: + - name: tickers + in: query + required: false + schema: + type: string + pattern: '^[A-Z0-9]+(,[A-Z0-9]+)*$' + description: | + Comma-separated list of ticker symbols. If omitted, returns data for all available tickers. + example: 'AAPL,SPY,QQQ' + - $ref: '../parameters/_index.yaml#/FormatParam' + - $ref: '../parameters/_index.yaml#/TokenParam' + responses: + '200': + description: Successful response with top-of-book and last price data + content: + application/json: + schema: + type: array + items: + $ref: '../schemas/iex-schemas.yaml#/IEXTopOfBook' + examples: + multiple-tickers: + summary: Multiple tickers response + value: + - ticker: 'AAPL' + timestamp: '2019-01-30T10:33:38.186520297-05:00' + quoteTimestamp: '2019-01-30T10:33:38.186520297-05:00' + lastSaleTimeStamp: '2019-01-30T10:33:34.176037579-05:00' + last: 162.37 + lastSize: 100 + tngoLast: 162.33 + prevClose: 154.68 + open: 161.83 + high: 163.25 + low: 160.38 + mid: 162.67 + volume: 0 + bidSize: 100 + bidPrice: 162.34 + askSize: 100 + askPrice: 163.0 + - ticker: 'SPY' + timestamp: '2019-01-30T11:12:29.505261845-05:00' + quoteTimestamp: '2019-01-30T11:12:29.505261845-05:00' + lastSaleTimeStamp: '2019-01-30T11:12:16.643833612-05:00' + last: 265.41 + lastSize: 617 + tngoLast: 265.405 + prevClose: 263.41 + open: 264.62 + high: 265.445 + low: 264.225 + mid: 265.405 + volume: 0 + bidSize: 500 + bidPrice: 265.39 + askSize: 100 + askPrice: 265.42 + text/csv: + schema: + type: string + '400': + $ref: '../responses/_index.yaml#/BadRequest' + '401': + $ref: '../responses/_index.yaml#/Unauthorized' + '404': + $ref: '../responses/_index.yaml#/NotFound' + '429': + $ref: '../responses/_index.yaml#/TooManyRequests' + '500': + $ref: '../responses/_index.yaml#/InternalServerError' + +iex-single: &iex-single + get: + summary: Get current top-of-book and last price for a specific ticker + description: | + Retrieve current top-of-book (bid/ask) and last price data for a specific ticker symbol. + Returns real-time reference prices or full TOPS feed data (requires IEX Exchange registration). + + This endpoint provides: + - Top-of-Book (Bid/Ask) data + - Last Sale (trade) data + - Tiingo-enriched convenience fields (tngoLast, mid, open, high, low) + - Volume data (IEX only during trading, all exchanges after close) + - Quotes updated to nanosecond precision + operationId: getIEXQuote + tags: + - IEX + parameters: + - $ref: '../parameters/_index.yaml#/TickerPathParam' + - $ref: '../parameters/_index.yaml#/FormatParam' + - $ref: '../parameters/_index.yaml#/TokenParam' + responses: + '200': + description: Successful response with top-of-book and last price data + content: + application/json: + schema: + type: array + items: + $ref: '../schemas/iex-schemas.yaml#/IEXTopOfBook' + minItems: 1 + maxItems: 1 + examples: + single-ticker: + summary: Single ticker response + value: + - ticker: 'AAPL' + timestamp: '2019-01-30T10:33:38.186520297-05:00' + quoteTimestamp: '2019-01-30T10:33:38.186520297-05:00' + lastSaleTimeStamp: '2019-01-30T10:33:34.176037579-05:00' + last: 162.37 + lastSize: 100 + tngoLast: 162.33 + prevClose: 154.68 + open: 161.83 + high: 163.25 + low: 160.38 + mid: 162.67 + volume: 0 + bidSize: 100 + bidPrice: 162.34 + askSize: 100 + askPrice: 163.0 + text/csv: + schema: + type: string + '400': + $ref: '../responses/_index.yaml#/BadRequest' + '401': + $ref: '../responses/_index.yaml#/Unauthorized' + '404': + $ref: '../responses/_index.yaml#/NotFound' + '429': + $ref: '../responses/_index.yaml#/TooManyRequests' + '500': + $ref: '../responses/_index.yaml#/InternalServerError' + +iex-prices: &iex-prices + get: + summary: Get historical intraday prices + description: | + Retrieve historical intraday prices for a stock in OHLC format. Supports various resampling frequencies + from 1-minute to daily bars. + + Features: + - OHLC (Open, High, Low, Close) data + - Configurable time intervals (1min to daily) + - Optional after-hours data inclusion + - Force-fill option for gaps in data + - IEX-only volume data (available with explicit columns parameter) + + Example use cases: + - Current day OHLC: `resampleFreq=1day` + - 5-minute bars: `startDate=2019-01-02&resampleFreq=5min` + - Hourly bars with gaps filled: `startDate=2025-12-01&resampleFreq=1hour&forceFill=true` + operationId: getIEXHistoricalPrices + tags: + - IEX + parameters: + - $ref: '../parameters/_index.yaml#/TickerPathParam' + - $ref: '../parameters/_index.yaml#/StartDateParam' + - $ref: '../parameters/_index.yaml#/EndDateParam' + - name: resampleFreq + in: query + required: false + schema: + type: string + pattern: '^\d+(min|hour|day)$' + default: '5min' + description: | + Frequency for resampling OHLC data. Format: number + unit (min/hour/day). + Minimum value is 1min. + Examples: '1min', '5min', '15min', '1hour', '4hour', '1day' + example: '5min' + - name: afterHours + in: query + required: false + schema: + type: boolean + default: false + description: If true, includes pre-market and post-market data if available + - name: forceFill + in: query + required: false + schema: + type: boolean + default: false + description: | + If true, fills gaps in data by using the previous OHLC values when no trade/quote update + occurred for a given time period + - name: columns + in: query + required: false + schema: + type: string + pattern: '^[a-z]+(,[a-z]+)*$' + description: | + Comma-separated list of columns to include in response. + Available columns: open, high, low, close, volume. + Note: Volume data is only exposed if explicitly requested. + example: 'open,high,low,close,volume' + - $ref: '../parameters/_index.yaml#/FormatParam' + - $ref: '../parameters/_index.yaml#/TokenParam' + responses: + '200': + description: Successful response with historical intraday price data + content: + application/json: + schema: + type: array + items: + $ref: '../schemas/iex-schemas.yaml#/IEXPrice' + examples: + five-minute-bars: + summary: 5-minute OHLC bars + value: + - date: '2019-01-02T14:30:00.000Z' + open: 154.74 + high: 155.52 + low: 154.58 + close: 154.76 + volume: 16102 + - date: '2019-01-02T14:35:00.000Z' + open: 154.8 + high: 155.0 + low: 154.31 + close: 154.645 + volume: 19127 + daily-bar: + summary: Daily OHLC bar + value: + - date: '2019-01-02T00:00:00.000Z' + open: 154.89 + high: 158.85 + low: 154.23 + close: 157.92 + text/csv: + schema: + type: string + '400': + $ref: '../responses/_index.yaml#/BadRequest' + '401': + $ref: '../responses/_index.yaml#/Unauthorized' + '404': + $ref: '../responses/_index.yaml#/NotFound' + '429': + $ref: '../responses/_index.yaml#/TooManyRequests' + '500': + $ref: '../responses/_index.yaml#/InternalServerError' diff --git a/openapi/paths/news.yaml b/openapi/paths/news.yaml new file mode 100644 index 0000000..f5eb155 --- /dev/null +++ b/openapi/paths/news.yaml @@ -0,0 +1,212 @@ +# News API Path Definitions +# Reference these using: $ref: '../paths/news.yaml#/PathName' + +news: &news + get: + summary: Get latest news articles + description: | + Retrieves the latest news articles from Tiingo's comprehensive news feeds. + Tiingo incorporates financial news sites as well as financial blogs and tags them using proprietary algorithms. + On a typical day, Tiingo adds over 8,000-12,000 articles. + + This endpoint supports filtering by tickers, tags, source domains, and date ranges. + Results can be sorted by either publishedDate or crawlDate in descending order. + operationId: getNews + tags: + - News + parameters: + - $ref: '../parameters/_index.yaml#/TokenParam' + - name: tickers + in: query + required: false + schema: + type: array + items: + type: string + pattern: '^[A-Z0-9]+$' + style: form + explode: false + description: Comma-separated list of ticker symbols to filter news articles + example: ["AAPL", "GOOGL"] + - name: tags + in: query + required: false + schema: + type: array + items: + type: string + style: form + explode: false + description: Comma-separated list of tags/countries/topics to filter news articles + example: ["election", "argentina"] + - name: source + in: query + required: false + schema: + type: array + items: + type: string + format: hostname + style: form + explode: false + description: Comma-separated list of source domains to filter news articles + example: ["bloomberg.com", "reuters.com"] + - $ref: '../parameters/_index.yaml#/StartDateParam' + - $ref: '../parameters/_index.yaml#/EndDateParam' + - name: limit + in: query + required: false + schema: + type: integer + format: int32 + minimum: 1 + maximum: 1000 + default: 100 + description: Maximum number of news objects to return. Default is 100, max is 1000. Contact support@tiingo.com for adjustments. + - name: offset + in: query + required: false + schema: + type: integer + format: int32 + minimum: 0 + default: 0 + description: Pagination variable used alongside limit. Returns results shifted by offset. Example - limit=100, offset=2 returns results 2-102 instead of 0-99. + - name: sortBy + in: query + required: false + schema: + type: string + enum: + - publishedDate + - crawlDate + default: publishedDate + description: The date field to sort results by in descending order. Defaults to publishedDate. + responses: + '200': + description: Successful response with news articles + content: + application/json: + schema: + type: array + items: + $ref: '../schemas/news-schemas.yaml#/NewsArticle' + examples: + singleArticle: + summary: Example news article + value: + - source: "cnbc.com" + crawlDate: "2019-01-29T22:20:01.696871Z" + description: "Apple CEO Tim Cook told CNBC that trade tensions between the U.S. and China have improved since late December." + url: "https://www.cnbc.com/2019/01/29/apples-ceo-sees-optimism-as-trade-tension-between-us-and-china-lessens.html" + publishedDate: "2019-01-29T22:17:00Z" + tags: ["China", "Economic Measures", "Economics", "Markets", "Stock", "Technology"] + tickers: ["AAPL"] + title: "Apple's CEO sees optimism as trade tension between U.S. and China lessens" + id: 28515261 + '400': + $ref: '../responses/_index.yaml#/BadRequest' + '401': + $ref: '../responses/_index.yaml#/Unauthorized' + '404': + $ref: '../responses/_index.yaml#/NotFound' + '429': + $ref: '../responses/_index.yaml#/TooManyRequests' + '500': + $ref: '../responses/_index.yaml#/InternalServerError' + +bulk-list: &bulk-list + get: + summary: List available bulk download files + description: | + Returns a list of all available bulk download files for the entire news database. + An "incremental" batchType file is added every evening. At 12am EST, a batch process + runs saving all news articles for the past 24 hours. + + **Note:** Bulk Download is only available to institutional clients. + operationId: listBulkDownloadFiles + tags: + - News + parameters: + - $ref: '../parameters/_index.yaml#/TokenParam' + responses: + '200': + description: Successful response with list of bulk download files + content: + application/json: + schema: + type: array + items: + $ref: '../schemas/news-schemas.yaml#/BulkDownloadFile' + examples: + bulkFileList: + summary: Example list of bulk download files + value: + - id: 755 + filename: "bulkfile_2019-01-28_2019-01-29.tar.gz" + batchType: "incremental" + startDate: "2019-01-28T05:00:00Z" + endDate: "2019-01-29T05:00:00Z" + url: "https://api.tiingo.com/tiingo/news/bulk_download/755?token=YOUR_API_TOKEN" + fileSizeUncompressed: 10385878 + fileSizeCompressed: 3018550 + - id: 754 + filename: "bulkfile_2019-01-27_2019-01-28.tar.gz" + batchType: "incremental" + startDate: "2019-01-27T05:00:00Z" + endDate: "2019-01-28T05:00:00Z" + url: "https://api.tiingo.com/tiingo/news/bulk_download/754?token=YOUR_API_TOKEN" + fileSizeUncompressed: 9854321 + fileSizeCompressed: 2945678 + '400': + $ref: '../responses/_index.yaml#/BadRequest' + '401': + $ref: '../responses/_index.yaml#/Unauthorized' + '404': + $ref: '../responses/_index.yaml#/NotFound' + '429': + $ref: '../responses/_index.yaml#/TooManyRequests' + '500': + $ref: '../responses/_index.yaml#/InternalServerError' + +bulk-download: &bulk-download + get: + summary: Download a specific bulk news file + description: | + Downloads a specific batch file by ID. The file contains news articles in compressed format (gzip). + Use the bulk-list endpoint to get the list of available files and their IDs. + + The downloaded file is in tar.gz format and contains news articles for the specified date range. + + **Note:** Bulk Download is only available to institutional clients. + operationId: downloadBulkFile + tags: + - News + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: int32 + description: The unique ID that corresponds to the batch file you would like to download + example: 755 + - $ref: '../parameters/_index.yaml#/TokenParam' + responses: + '200': + description: Successful response with bulk download file (binary tar.gz) + content: + application/gzip: + schema: + type: string + format: binary + '400': + $ref: '../responses/_index.yaml#/BadRequest' + '401': + $ref: '../responses/_index.yaml#/Unauthorized' + '404': + $ref: '../responses/_index.yaml#/NotFound' + '429': + $ref: '../responses/_index.yaml#/TooManyRequests' + '500': + $ref: '../responses/_index.yaml#/InternalServerError' diff --git a/openapi/schemas/eod-schemas.yaml b/openapi/schemas/eod-schemas.yaml new file mode 100644 index 0000000..1c123a3 --- /dev/null +++ b/openapi/schemas/eod-schemas.yaml @@ -0,0 +1,119 @@ +# End-of-Day Stock Price API Schemas +# Reference: https://www.tiingo.com/documentation/end-of-day + +PriceData: &PriceData + type: array + description: Array of End-of-Day price data objects with OHLCV (Open, High, Low, Close, Volume) data + items: + type: object + properties: + date: + $ref: '../schemas/common.yaml#/Date' + description: The date this data pertains to + open: + type: number + format: float + description: The opening price for the asset on the given date + example: 150.25 + high: + type: number + format: float + description: The high price for the asset on the given date + example: 152.50 + low: + type: number + format: float + description: The low price for the asset on the given date + example: 149.75 + close: + type: number + format: float + description: The closing price for the asset on the given date + example: 151.80 + volume: + type: integer + format: int64 + description: The number of shares traded for the asset + example: 50000000 + adjOpen: + type: number + format: float + description: The adjusted opening price for the asset on the given date (includes splits and dividends) + example: 150.25 + adjHigh: + type: number + format: float + description: The adjusted high price for the asset on the given date (includes splits and dividends) + example: 152.50 + adjLow: + type: number + format: float + description: The adjusted low price for the asset on the given date (includes splits and dividends) + example: 149.75 + adjClose: + type: number + format: float + description: The adjusted closing price for the asset on the given date (includes splits and dividends) + example: 151.80 + adjVolume: + type: integer + format: int64 + description: The number of shares traded for the asset (adjusted for splits) + example: 50000000 + divCash: + type: number + format: float + description: The dividend paid out on the given date (note that date will be the exDate for the dividend) + example: 0.0 + splitFactor: + type: number + format: float + description: The factor used to adjust prices when a company splits, reverse splits, or pays a distribution + example: 1.0 + required: + - date + - close + - volume + +TickerMetadata: &TickerMetadata + type: object + description: Metadata information about a stock ticker + properties: + ticker: + $ref: '../schemas/common.yaml#/Ticker' + description: Ticker related to the asset + name: + type: string + description: Full-length name of the asset + example: "Apple Inc" + exchangeCode: + type: string + description: An identifier that maps which Exchange this asset is listed on + enum: + - NASDAQ + - NYSE + - AMEX + - OTC + - BATS + - IEX + example: "NASDAQ" + description: + type: string + description: Long-form description of the asset + example: "Apple Inc is an American multinational technology company that specializes in consumer electronics, software and online services." + startDate: + type: string + format: date + nullable: true + description: The earliest date we have price data available for the asset. When null, no price data is available + example: "1990-01-01" + endDate: + type: string + format: date + nullable: true + description: The latest date we have price data available for the asset. When null, no price data is available + example: "2024-01-01" + required: + - ticker + - name + - exchangeCode diff --git a/openapi/schemas/iex-schemas.yaml b/openapi/schemas/iex-schemas.yaml new file mode 100644 index 0000000..6aa7f5b --- /dev/null +++ b/openapi/schemas/iex-schemas.yaml @@ -0,0 +1,220 @@ +# IEX Exchange API Response Schemas +# Reference: https://api.tiingo.com/documentation/iex + +IEXTopOfBook: &IEXTopOfBook + type: object + description: | + Top-of-book and last price data for a stock on IEX Exchange. + + Note: Fields marked with "*IEX entitlement required*" will return null unless you are + registered with the IEX Exchange and have a market data policy in place. These fields + provide full TOPS feed data including direct bid/ask/last data from IEX. + + Tiingo-enriched fields (tngoLast, mid, open, high, low) are calculated by Tiingo + and do not require IEX entitlement. + properties: + ticker: + $ref: '../schemas/common.yaml#/Ticker' + description: Ticker symbol for the asset + timestamp: + $ref: '../schemas/common.yaml#/DateTime' + description: Timestamp when the data was last refreshed + quoteTimestamp: + type: string + format: date-time + nullable: true + description: | + Timestamp when the last quote (bid/ask) data was received from IEX. + Requires IEX entitlement. Null if not entitled. + lastSaleTimeStamp: + type: string + format: date-time + nullable: true + description: | + Timestamp when the last trade (last/lastSize) data was received from IEX. + Requires IEX entitlement. Null if not entitled. + last: + type: number + format: double + nullable: true + description: | + Last trade price executed on IEX. + Requires IEX entitlement. Null if not entitled. + example: 162.37 + lastSize: + type: integer + format: int32 + nullable: true + description: | + Number of shares traded at the last price on IEX. + Requires IEX entitlement. Null if not entitled. + example: 100 + tngoLast: + type: number + format: double + description: | + Tiingo-calculated last price. Either the last trade price or mid price. + The mid price is only used if the spread is not considered too wide by Tiingo's algorithm. + After the official exchange print comes in, this value changes to that value. + This is a Tiingo-enriched field and does not require IEX entitlement. + example: 162.33 + prevClose: + type: number + format: double + description: | + Previous day's closing price of the security. + Can be from any exchange (NYSE, NASDAQ, IEX, etc.) + example: 154.68 + open: + type: number + format: double + nullable: true + description: | + Opening price of the asset on the current day. + Tiingo-calculated field, does not require IEX entitlement. + example: 161.83 + high: + type: number + format: double + nullable: true + description: | + High price of the asset on the current day. + Tiingo-calculated field, does not require IEX entitlement. + example: 163.25 + low: + type: number + format: double + nullable: true + description: | + Low price of the asset on the current day. + Tiingo-calculated field, does not require IEX entitlement. + example: 160.38 + mid: + type: number + format: double + nullable: true + description: | + Mid price at current timestamp when both bidPrice and askPrice are not null. + Formula: mid = (bidPrice + askPrice) / 2.0 + Tiingo-calculated field, does not require IEX entitlement. + example: 162.67 + volume: + type: integer + format: int64 + description: | + Volume data. IEX volume throughout the trading day. + Once the official closing price is received, reflects total volume across all exchanges. + This field is provided for convenience. + example: 0 + bidSize: + type: number + format: double + nullable: true + description: | + Number of shares available at the bid price. + Requires IEX entitlement. Null if not entitled. + example: 100 + bidPrice: + type: number + format: double + nullable: true + description: | + Current bid price. + Requires IEX entitlement. Null if not entitled. + example: 162.34 + askSize: + type: number + format: double + nullable: true + description: | + Number of shares available at the ask price. + Requires IEX entitlement. Null if not entitled. + example: 100 + askPrice: + type: number + format: double + nullable: true + description: | + Current ask price. + Requires IEX entitlement. Null if not entitled. + example: 163.0 + required: + - ticker + - timestamp + - tngoLast + - prevClose + - volume + example: + ticker: 'AAPL' + timestamp: '2019-01-30T10:33:38.186520297-05:00' + quoteTimestamp: '2019-01-30T10:33:38.186520297-05:00' + lastSaleTimeStamp: '2019-01-30T10:33:34.176037579-05:00' + last: 162.37 + lastSize: 100 + tngoLast: 162.33 + prevClose: 154.68 + open: 161.83 + high: 163.25 + low: 160.38 + mid: 162.67 + volume: 0 + bidSize: 100 + bidPrice: 162.34 + askSize: 100 + askPrice: 163.0 + +IEXPrice: &IEXPrice + type: object + description: | + Historical intraday price data in OHLC format from IEX Exchange. + + The time period covered by each bar is determined by the resampleFreq parameter. + Volume data is IEX-only and must be explicitly requested using the columns parameter. + properties: + date: + $ref: '../schemas/common.yaml#/DateTime' + description: | + Timestamp for this OHLC bar. Marks the beginning of the time period. + Format: ISO 8601 (RFC 3339) + open: + type: number + format: double + description: Opening price for the time period + example: 154.74 + high: + type: number + format: double + description: Highest price during the time period + example: 155.52 + low: + type: number + format: double + description: Lowest price during the time period + example: 154.58 + close: + type: number + format: double + description: Closing price for the time period + example: 154.76 + volume: + type: integer + format: int64 + nullable: true + description: | + Number of shares traded on IEX only during the time period. + This field is only included if explicitly requested via the columns parameter + (e.g., ?columns=open,high,low,close,volume) + example: 16102 + required: + - date + - open + - high + - low + - close + example: + date: '2019-01-02T14:30:00.000Z' + open: 154.74 + high: 155.52 + low: 154.58 + close: 154.76 + volume: 16102 diff --git a/openapi/schemas/news-schemas.yaml b/openapi/schemas/news-schemas.yaml new file mode 100644 index 0000000..680a462 --- /dev/null +++ b/openapi/schemas/news-schemas.yaml @@ -0,0 +1,114 @@ +# News API Schema Definitions +# Reference these using: $ref: '../schemas/news-schemas.yaml#/SchemaName' + +NewsArticle: &NewsArticle + type: object + description: A news article with ticker and tag associations + properties: + id: + type: integer + format: int32 + description: Unique identifier specific to the news article + example: 28515261 + title: + type: string + description: Title of the news article + example: "Apple's CEO sees optimism as trade tension between U.S. and China lessens" + url: + type: string + format: uri + description: URL of the news article + example: "https://www.cnbc.com/2019/01/29/apples-ceo-sees-optimism-as-trade-tension-between-us-and-china-lessens.html" + description: + type: string + description: Long-form description of the news story + example: "Apple CEO Tim Cook told CNBC that trade tensions between the U.S. and China have improved since late December." + publishedDate: + type: string + format: date-time + description: The datetime the news story was published in UTC. Usually reported by the news source, or the time discovered by Tiingo's crawler if not declared. + example: "2019-01-29T22:17:00Z" + crawlDate: + type: string + format: date-time + description: The datetime the news story was added to the database in UTC. Always recorded by Tiingo. Large gaps between crawlDate and publishedDate indicate backfilled articles. + example: "2019-01-29T22:20:01.696871Z" + source: + type: string + description: The domain the news source is from + example: "cnbc.com" + tickers: + type: array + items: + type: string + pattern: '^[A-Z0-9]+$' + description: Tickers mentioned in the news story using Tiingo's proprietary tagging algorithm + example: ["AAPL"] + tags: + type: array + items: + type: string + description: Tags mapped and discovered by Tiingo using Tiingo's proprietary tagging algorithm + example: ["China", "Economic Measures", "Economics", "Markets", "Stock", "Technology"] + required: + - id + - title + - url + - publishedDate + - crawlDate + - source + +BulkDownloadFile: &BulkDownloadFile + type: object + description: Metadata for a bulk news download file (institutional clients only) + properties: + id: + type: integer + format: int32 + description: Unique identifier specific to the bulk download file. Used to select which file to download. + example: 755 + filename: + type: string + description: The filename of the batch file + example: "bulkfile_2019-01-28_2019-01-29.tar.gz" + batchType: + type: string + enum: + - base + - incremental + description: "Describes what kind of batch file this is: 'base' is an entire dump of the data, 'incremental' is a partial dump of the data" + example: "incremental" + startDate: + type: string + format: date-time + description: The start date used to select the News objects to generate the batch file. This is inclusive (publishedDate >= startDate). + example: "2019-01-28T05:00:00Z" + endDate: + type: string + format: date-time + description: The end date used to select the News objects to generate the batch file. This is not inclusive (publishedDate < endDate). + example: "2019-01-29T05:00:00Z" + url: + type: string + format: uri + description: A url to directly download the batch file. NOTE - This url contains your Auth Token and is meant to be a copy/paste url for convenience. + example: "https://api.tiingo.com/tiingo/news/bulk_download/755?token=YOUR_API_TOKEN" + fileSizeUncompressed: + type: integer + format: int64 + description: The size of the file in bytes uncompressed + example: 10385878 + fileSizeCompressed: + type: integer + format: int64 + description: The size of the file in bytes compressed using gzip + example: 3018550 + required: + - id + - filename + - batchType + - startDate + - endDate + - url + - fileSizeUncompressed + - fileSizeCompressed