← research2026-07-05 · 7 min read

How to Build a Point-in-Time Fundamentals Database from SEC EDGAR (and When Not To)

If you backtest with today's fundamentals, you are cheating yourself. The Revenue figure you pull for Q4 2019 was probably restated in 2021, and the restated number was not knowable on the day you would have traded. That gap is lookahead bias, and it is why "point-in-time" (PIT) fundamentals exist: a dataset that answers what did filers report, and when did the market first see it?

The good news: the raw material is free and public. The SEC's EDGAR system publishes structured XBRL financials for every US filer, and with enough patience you can assemble a real PIT database yourself. The honest news: a few steps are fiddly enough that most DIY builds ship a subtle bug. This guide teaches the whole pipeline — our full methodology is public on GitHub — then weighs the cost fairly so you can decide whether to build or buy.

The build: EDGAR companyfacts, step by step

1. Pull companyfacts. EDGAR exposes a per-company JSON blob at data.sec.gov/api/xbrl/companyfacts/CIK{10-digit}.json. It contains every XBRL fact the company has ever tagged, grouped by taxonomy (us-gaap, dei) and concept, each with an array of reported values. This is your source of truth. Respect the SEC's fair-access rules (declare a User-Agent, throttle to ~10 requests/sec).

2. Filter to annual 10-K facts. Each fact carries a form (10-K, 10-K/A, 10-Q, 8-K…) and, for flow concepts like Revenue, a start/end window. You want annual figures, so keep 10-K and 10-K/A (amendments) and filter duration concepts to roughly 365-day windows. Skip this and you will silently mix quarterly and annual Revenue into the same series — a classic corruption.

3. Resolve XBRL synonym tags across years. This is where builds quietly break. Companies change the tag they use for the same economic concept. Revenue might be Revenues one year, RevenueFromContractWithCustomerExcludingAssessedTax the next, and SalesRevenueNet in an older filing. If you map only one tag, you get holes exactly where a company evolved its reporting. You need an ordered synonym list per concept and a deterministic resolution rule so the same logical field is populated every year.

4. Stamp first_filed. For each value, record the date it first appeared in a filing (the accession's filing date), not the fiscal period end. This first_filed stamp is the entire point of PIT: a backtest asks "what was known as of date X?" and you answer by returning only rows where first_filed <= X. Same-day filings should be inclusive.

5. Detect same-tag restatements. When a later 10-K or 10-K/A reports a different value for a period you already have, that is a restatement. Keep both: the original_value (first-reported, PIT-safe) and the latest_value (current best estimate), plus a restated flag. Use a tolerance — we flag when the same tag's value moves more than 0.5% — so rounding noise does not masquerade as a restatement.

6. QA every row. Sanity-check signs, magnitudes, and duplicate periods; carry a qa_status so consumers can filter. Fundamentals data is dirty; a QA column is not optional.

The part everyone underestimates

Restatement reconstruction is deceptively hard, and we say that from experience: our own audit found a bug in exactly this step. It is easy to write logic that looks right on Apple and Microsoft — clean filers with stable tags — and quietly mislabels the messier 80% of the market. Tag switches (step 3) and restatement detection (step 5) are where a DIY dataset silently drifts from ground truth, and you often won't notice until a backtest looks suspiciously good. Budget real test coverage across small caps, amenders, and tag-switchers, not just the mega-caps.

Build vs. buy: an honest comparison

Build from EDGAR Tradevo Data ($49/mo) Research-grade vendors
Cost $0 + your time $49/mo Higher / quote-based
Setup Days to weeks Minutes (key after checkout) Varies
PIT correctness Yours to get right first_filed, original vs. latest, restatement flags Yes (their core)
Coverage Whatever you build 5,214 US companies, annual only Often broader (quarterly, global)
History As far as you pull Up to 12 fiscal years Often 20-25+ years
Restatements You reconstruct 18,539 labeled Handled
Bulk / Parquet Build it JSON API only (no bulk yet) Often available
Methodology Yours Public Usually opaque

Credible paid PIT options exist and we won't pretend otherwise. Sharadar Core US Fundamentals (via Nasdaq Data Link) is a well-regarded point-in-time dataset with deep history; its personal pricing is not publicly listed as of July 2026, so check their page. Tiingo offers a Power plan at $30/mo individual / $50/mo commercial as of July 2026, with fundamentals sold as a separate API add-on (pricing on request) and an as-reported option of its own — see their pricing. Both are legitimate; verify current terms before you buy, because vendor pricing moves.

When to build it yourself

When buying is the better choice

Start free, either way

Whichever path you pick, start by looking at real PIT data. Our free GitHub sample has 40 large caps, 3,212 rows, and the complete methodology — tag resolution, first_filed stamping, same-tag restatement detection, QA — with no signup. Read it, copy the approach, and build your own. If you'd rather skip the fiddly parts, Tradevo Data serves the same discipline as one JSON endpoint (/v1/fundamentals?ticker&as_of) with server-side as_of filtering, 5,000 requests/day, and an instant key after checkout — cancel anytime.

Build it or buy it. Just don't backtest on restated numbers and call it edge.


Not investment advice. Tradevo Data provides point-in-time US equity fundamentals sourced from public SEC EDGAR filings; it does not make performance claims. Competitor pricing and features are as of July 2026 — always verify current terms on each vendor's own page before purchasing.

Check your own backtest against the free sample.

40 large caps, 3,212 point-in-time rows, full methodology — no signup.