fundamental-and-macro-datalisted
Install: claude install-skill howard-lynn-ye/fin-skills
# Fundamentals and macro data
Both halves of this domain share one failure: **the obvious join is a look-ahead bug.** Fundamentals
are published months after the period they describe and are then rewritten; macro series are revised
for years. Sections 2 and 5 are the ones that change your results.
## 1. SEC EDGAR — the two hard rules
```python
HDR = {"User-Agent": "Your Company you@example.com"} # REQUIRED — no UA → HTTP 403
```
✅ Empirically confirmed: no User-Agent → **403**; any UA → 200. The header is enforced for
*presence*, not content — but sending a fake browser UA is a policy violation and gets IPs blocked.
✅ **Rate limit: 10 requests/second**, quoted from the SEC webmaster FAQ.
| Endpoint | Detail |
|---|---|
| `data.sec.gov/submissions/CIK##########.json` | Zero-padded 10-digit CIK. `filings.recent` caps at ~1,000; older paginate via `filings.files[]` |
| `data.sec.gov/api/xbrl/companyfacts/CIK##########.json` | AAPL = **3.8 MB**, 503 us-gaap tags. Fact fields: `start, end, val, accn, fy, fp, form, filed, frame` |
| `data.sec.gov/api/xbrl/companyconcept/CIK##########/us-gaap/<Tag>.json` | Single tag, same fact schema |
| `data.sec.gov/api/xbrl/frames/us-gaap/<Tag>/USD/CY2023.json` | 🚨 **not point-in-time — see §2.3** |
| `efts.sec.gov/LATEST/search-index?q=…&forms=10-K` | Full-text search. ✅ **Coverage starts 2001** — it does *not* reach 1994–2000 filings |
| `sec.gov/files/company_tickers.json` | 10,412 rows. 🚨 **A current snapshot — survivorship-biased**