{
  "openapi": "3.1.0",
  "info": {
    "title": "Tradevo Data API",
    "version": "1.0.0",
    "summary": "Point-in-time US equity fundamentals from SEC EDGAR.",
    "description": "Fundamentals returned as first reported, each stamped with the date it became public (`filed`), so backtests avoid lookahead bias. One ticker per request, key-metered. Get a key at https://tradevodata.com.",
    "contact": {
      "name": "Tradevo Data",
      "url": "https://tradevodata.com"
    },
    "license": {
      "name": "Source data: U.S. SEC EDGAR (public domain)"
    }
  },
  "servers": [
    {
      "url": "https://tradevodata.com"
    }
  ],
  "security": [
    {
      "apiKeyAuth": []
    }
  ],
  "paths": {
    "/v1/fundamentals": {
      "get": {
        "operationId": "getFundamentals",
        "summary": "Point-in-time fundamentals for a ticker, as of a date",
        "description": "Returns the most recent fundamental values for the requested reporting cadence that had already been filed on or before `as_of` (first_filed <= as_of). `period=annual` is the backward-compatible default; `period=quarterly` selects the isolated quarterly dataset. The 7-day free trial permits 10 companies, a rolling 3-year as_of window and 100 requests/day; Pro unlocks the complete available history. Point-in-time correct \u2014 no lookahead.",
        "parameters": [
          {
            "name": "ticker",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z0-9.\\-]{1,12}$"
            },
            "example": "AAPL",
            "description": "US stock symbol (1\u201312 chars: A\u2013Z, 0\u20139, '.', '-'). Share classes and other aliases resolve to the SEC filer they belong to (GOOG \u2192 GOOGL, BRK-A \u2192 BRK-B, preferred-share tickers such as BAC-PK \u2192 BAC, and roughly 1,500 more); when that happens the response echoes the ticker you sent and adds `resolved_ticker` and `resolved_note`."
          },
          {
            "name": "as_of",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "example": "2024-06-30",
            "description": "Return only values that were public on or before this date (YYYY-MM-DD). Evaluation keys are limited to a rolling 3-year window; Pro keys can query the complete available history."
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "annual",
                "quarterly"
              ],
              "default": "annual"
            },
            "description": "Reporting cadence. Omit for annual behavior. Quarterly is available only after the quarterly dataset has passed its release gate."
          },
          {
            "name": "concept",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "Revenue",
                "NetIncome",
                "Assets",
                "StockholdersEquity",
                "OperatingCashFlow",
                "EPSDiluted",
                "DilutedShares",
                "GrossProfit",
                "OperatingIncome",
                "PretaxIncome",
                "IncomeTaxExpense",
                "CapitalExpenditures",
                "CashAndCashEquivalents",
                "CurrentAssets",
                "CurrentLiabilities",
                "NetPPE"
              ]
            },
            "description": "Optional. Restrict to one concept (case-insensitive). Omit to return all available. Quarterly supports Revenue, NetIncome, OperatingCashFlow, EPSDiluted, DilutedShares, Assets, and StockholdersEquity."
          }
        ],
        "responses": {
          "200": {
            "description": "Point-in-time fundamentals. May be an empty set with a `note` if nothing had been filed yet. The `data_through` value in the example is illustrative \u2014 it advances with every data load.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FundamentalsResponse"
                },
                "example": {
                  "ticker": "AAPL",
                  "as_of": "2024-06-30",
                  "period": "annual",
                  "data_through": "2026-07-24",
                  "count": 1,
                  "fundamentals": [
                    {
                      "concept": "Revenue",
                      "fiscal_year": 2023,
                      "fiscal_period": "FY",
                      "period_end": "2023-09-30",
                      "period_start": null,
                      "filed": "2023-11-03",
                      "value": 383285000000,
                      "ytd_value": null,
                      "derivation": "reported",
                      "latest_value": 383285000000,
                      "restated": false,
                      "qa_status": "clean"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid ticker, as_of, period, or concept; or quarterly access is not yet enabled.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Evaluation company cap reached or as_of falls outside the rolling 3-year evaluation window.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ticker not in the Tradevo Data universe.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Daily request limit exceeded."
          },
          "500": {
            "description": "Internal error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Service temporarily unavailable (database unreachable). Retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "Service + dataset health",
        "security": [],
        "responses": {
          "200": {
            "description": "Healthy.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "example": true
                    },
                    "rows": {
                      "type": "integer",
                      "description": "Live row count for concepts published by the current deployment.",
                      "example": 312751
                    },
                    "published_rows": {
                      "type": "integer",
                      "description": "Row count the current site deploy advertises.",
                      "example": 312751
                    },
                    "stale_build": {
                      "type": "boolean",
                      "description": "true when rows != published_rows.",
                      "example": false
                    },
                    "quarterly_rows": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "Live row count for quarterly concepts. null only when the additive quarterly schema is not installed yet.",
                      "example": 1090028
                    },
                    "quarterly_schema_ready": {
                      "type": "boolean",
                      "description": "Whether the isolated quarterly table is installed and queryable.",
                      "example": true
                    },
                    "published_quarterly_rows": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "Quarterly row count advertised by the current release, or null before quarterly publication.",
                      "example": 1090028
                    },
                    "stale_build_quarterly": {
                      "type": [
                        "boolean",
                        "null"
                      ],
                      "description": "true when quarterly_rows differs from published_quarterly_rows; null before quarterly publication.",
                      "example": false
                    },
                    "quarterly_public": {
                      "type": "boolean",
                      "description": "Whether period=quarterly is enabled for public API traffic in this deployment.",
                      "example": true
                    },
                    "db_ms": {
                      "type": "integer",
                      "description": "Database round-trip time in milliseconds.",
                      "example": 12
                    }
                  },
                  "required": [
                    "ok",
                    "rows",
                    "published_rows",
                    "stale_build",
                    "quarterly_rows",
                    "quarterly_schema_ready",
                    "published_quarterly_rows",
                    "stale_build_quarterly",
                    "quarterly_public",
                    "db_ms"
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Service temporarily unavailable (database unreachable): `{ ok: false, error }`. Retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Public liveness check, no key needed. Annual and quarterly live row counts are reported separately. `quarterly_schema_ready` reports whether the additive table exists; `quarterly_public` remains false until the release flag is enabled, even if a dark-loaded table is present. Responses are edge-cached for 60 seconds."
      }
    },
    "/v1/download": {
      "get": {
        "operationId": "getBulkDownload",
        "summary": "Full dataset as one gzipped CSV",
        "description": "The entire point-in-time dataset for the requested cadence as a streamed gzipped CSV. Annual columns: ticker, cik, concept, xbrl_tag, fiscal_year, period_end, first_filed, lag_days, filed_reliable, original_value, latest_value, restated, qa_status. Quarterly appends fiscal_period, period_start, ytd_value, derivation, and source_form. Included in the flat $29/mo plan. Costs 1 request unit; both cadences share the cap of 3 downloads per key per UTC day. Verify your file against the `x-dataset-sha256` header.",
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "annual",
                "quarterly"
              ],
              "default": "annual"
            },
            "description": "Dataset cadence. Omit for the backward-compatible annual export."
          }
        ],
        "responses": {
          "200": {
            "description": "The streamed gzipped CSV. Headers: `x-dataset-sha256` (sha256 of the .csv.gz bytes), `x-dataset-rows`, `x-dataset-generated-at`, and `x-dataset-period`. Use HEAD to read metadata including Content-Length without transferring the body.",
            "content": {
              "application/gzip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Bulk downloads require an active Pro subscription; evaluation keys are per-company only.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Feature not yet available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Daily request quota or daily download limit (3) exceeded. Resets at 00:00 UTC (see Retry-After)."
          },
          "503": {
            "description": "Export not generated yet.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/snapshot": {
      "get": {
        "operationId": "getSnapshot",
        "summary": "Whole-universe point-in-time cross-section, as of a date",
        "description": "For every ticker (and every concept, unless filtered), returns the most recent value for the requested cadence that was already public on or before `as_of` (first_filed <= as_of). `period=annual` is the backward-compatible default. One call per rebalance date is all a cross-sectional backtest needs. Costs 25 request units against the daily quota.",
        "parameters": [
          {
            "name": "as_of",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "example": "2024-06-30",
            "description": "Return only values that were public on or before this date (YYYY-MM-DD)."
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "annual",
                "quarterly"
              ],
              "default": "annual"
            },
            "description": "Reporting cadence. Omit for annual behavior."
          },
          {
            "name": "concept",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "Revenue",
                "NetIncome",
                "Assets",
                "StockholdersEquity",
                "OperatingCashFlow",
                "EPSDiluted",
                "DilutedShares",
                "GrossProfit",
                "OperatingIncome",
                "PretaxIncome",
                "IncomeTaxExpense",
                "CapitalExpenditures",
                "CashAndCashEquivalents",
                "CurrentAssets",
                "CurrentLiabilities",
                "NetPPE"
              ]
            },
            "description": "Optional. Restrict to one concept (case-insensitive). Omit to return every available concept for the requested as-of date. Quarterly supports Revenue, NetIncome, OperatingCashFlow, EPSDiluted, DilutedShares, Assets, and StockholdersEquity."
          }
        ],
        "responses": {
          "200": {
            "description": "The point-in-time cross-section.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SnapshotResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid as_of, period, or concept; or quarterly access is not yet enabled.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Snapshot access requires an active Pro subscription; evaluation keys are per-company only.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Feature not yet available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Daily request quota exceeded. Resets at 00:00 UTC (see Retry-After)."
          },
          "500": {
            "description": "Internal error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Service temporarily unavailable (database unreachable). Retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "Your Tradevo Data API key (starts with `tvd_`). Get one at https://tradevodata.com."
      }
    },
    "schemas": {
      "FundamentalsResponse": {
        "type": "object",
        "properties": {
          "ticker": {
            "type": "string"
          },
          "resolved_ticker": {
            "type": "string",
            "example": "GOOGL",
            "description": "Present only when `ticker` was an alias (share class, preferred-share ticker, renamed issuer) that resolved to a different filer-level ticker. Fundamentals are reported under this ticker."
          },
          "resolved_note": {
            "type": "string",
            "example": "GOOG and GOOGL are share classes of the same SEC filer; fundamentals are reported at the filer level.",
            "description": "Present only alongside `resolved_ticker`. Human-readable explanation of the alias resolution."
          },
          "as_of": {
            "type": "string",
            "format": "date"
          },
          "period": {
            "type": "string",
            "enum": [
              "annual",
              "quarterly"
            ],
            "description": "Reporting cadence used for this response."
          },
          "count": {
            "type": "integer"
          },
          "fundamentals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Fundamental"
            }
          },
          "note": {
            "type": "string",
            "description": "Present only when count is 0."
          },
          "data_through": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "example": "2026-07-22",
            "description": "The newest first_filed date in the dataset. The dataset is a snapshot; filings published after this date are not reflected. The example value is illustrative; the live value advances with every data load."
          },
          "coverage_warning": {
            "type": "string",
            "description": "Present only when as_of is later than data_through."
          },
          "staleness_note": {
            "type": "string",
            "description": "Present only when one or more returned rows are flagged stale_for_as_of."
          }
        },
        "required": [
          "ticker",
          "as_of",
          "period",
          "count",
          "fundamentals"
        ]
      },
      "Fundamental": {
        "type": "object",
        "properties": {
          "concept": {
            "type": "string",
            "example": "Revenue"
          },
          "fiscal_year": {
            "type": "integer",
            "example": 2023
          },
          "fiscal_period": {
            "type": "string",
            "enum": [
              "FY",
              "Q1",
              "Q2",
              "Q3",
              "Q4"
            ],
            "description": "FY for annual responses; fiscal quarter for quarterly responses."
          },
          "period_end": {
            "type": "string",
            "format": "date"
          },
          "period_start": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Quarter start for duration concepts. null for annual responses and instant concepts."
          },
          "filed": {
            "type": "string",
            "format": "date",
            "description": "Date this value first became public (point-in-time key)."
          },
          "value": {
            "type": [
              "number",
              "null"
            ],
            "description": "First-knowable (point-in-time) value. null when suppressed as implausible \u2014 see qa_status."
          },
          "ytd_value": {
            "type": [
              "number",
              "null"
            ],
            "description": "Quarter-to-date source value before differencing, when applicable. null for annual responses, instant concepts, and non-cumulative reported quarters."
          },
          "derivation": {
            "type": "string",
            "enum": [
              "reported",
              "ytd_diff",
              "fy_minus_9m",
              "fy_balance"
            ],
            "description": "How the returned cadence value was obtained. ytd_diff subtracts the prior cumulative filing; fy_minus_9m derives a Q4 flow from FY minus the first nine months; fy_balance carries the annual year-end instant into a Q4 balance."
          },
          "latest_value": {
            "type": [
              "number",
              "null"
            ],
            "description": "Most recent revision. May post-date as_of, so it is NOT point-in-time safe. null when suppressed."
          },
          "restated": {
            "type": "boolean",
            "description": "True if later amended by more than 0.5%."
          },
          "qa_status": {
            "type": "string",
            "example": "clean",
            "description": "Per-row quality verdict. clean, or FLAG: followed by semicolon-separated reasons. lag_out_of_range uses the cadence-specific filing window (annual: 0-120 days; quarterly: 0-90 days). stale_for_as_of means the newest period ends more than ~18 months before as_of for annual data or ~9 months for quarterly data. Other reasons identify magnitude, tag-selection, scale/unit, or tag-switch concerns."
          },
          "lag_days": {
            "type": [
              "integer",
              "null"
            ],
            "example": 58,
            "description": "Days from period_end to first_filed \u2014 how long after the fiscal period ended this value became public."
          }
        }
      },
      "SnapshotResponse": {
        "type": "object",
        "properties": {
          "as_of": {
            "type": "string",
            "format": "date"
          },
          "period": {
            "type": "string",
            "enum": [
              "annual",
              "quarterly"
            ],
            "description": "Reporting cadence used for this response."
          },
          "concept": {
            "type": "string",
            "description": "Present only when the request filtered by concept."
          },
          "count": {
            "type": "integer"
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SnapshotRow"
            }
          },
          "data_through": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "example": "2026-07-22",
            "description": "The newest first_filed date in the dataset. The dataset is a snapshot; filings published after this date are not reflected. The example value is illustrative; the live value advances with every data load."
          },
          "coverage_warning": {
            "type": "string",
            "description": "Present only when as_of is later than data_through."
          },
          "staleness_note": {
            "type": "string",
            "description": "Present only when one or more returned rows are flagged stale_for_as_of."
          }
        },
        "required": [
          "as_of",
          "period",
          "count",
          "rows"
        ]
      },
      "SnapshotRow": {
        "type": "object",
        "properties": {
          "ticker": {
            "type": "string",
            "example": "AAPL"
          },
          "concept": {
            "type": "string",
            "example": "Revenue"
          },
          "fiscal_year": {
            "type": "integer",
            "example": 2023
          },
          "fiscal_period": {
            "type": "string",
            "enum": [
              "FY",
              "Q1",
              "Q2",
              "Q3",
              "Q4"
            ]
          },
          "period_end": {
            "type": "string",
            "format": "date"
          },
          "period_start": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "filed": {
            "type": "string",
            "format": "date",
            "description": "Date this value first became public (point-in-time key)."
          },
          "value": {
            "type": [
              "number",
              "null"
            ],
            "description": "First-knowable (point-in-time) value. null when suppressed as implausible \u2014 see qa_status."
          },
          "ytd_value": {
            "type": [
              "number",
              "null"
            ]
          },
          "derivation": {
            "type": "string",
            "enum": [
              "reported",
              "ytd_diff",
              "fy_minus_9m",
              "fy_balance"
            ]
          },
          "latest_value": {
            "type": [
              "number",
              "null"
            ],
            "description": "Most recent revision. May post-date as_of, so it is NOT point-in-time safe. null when suppressed."
          },
          "restated": {
            "type": "boolean"
          },
          "qa_status": {
            "type": "string",
            "example": "clean",
            "description": "Per-row quality verdict. clean, or FLAG: followed by semicolon-separated reasons. lag_out_of_range uses 0-120 days for annual data and 0-90 days for quarterly data; stale_for_as_of uses ~18 months annual and ~9 months quarterly."
          },
          "lag_days": {
            "type": [
              "integer",
              "null"
            ],
            "example": 58,
            "description": "Days from period_end to first_filed \u2014 how long after the fiscal period ended this value became public."
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          }
        },
        "required": [
          "error"
        ]
      }
    }
  }
}
