← back to Uspto Trtyrap

README.md

22 lines

# USPTO TRTYRAP bulk download

**Dataset:** TRTYRAP — Trademark Full Text XML Data (No Images), Annual Applications,
backfile APR 1884 – DEC 31 2025. 177 files (~15–20 GB). Fields: word mark, serial #,
registration #, filing/registration dates, goods & services, classifications, status
codes, design search codes, pseudo marks.

## Why the API (not scraping)
The raw file bytes (`data.uspto.gov/files/TRTYRAP/*.zip`, CloudFront-signed) sit behind
**AWS WAF bot-control** that serves the SPA shell to plain curl AND curl_cffi Chrome-TLS
impersonation. Only the real browser — or the **official Bulk Data API with `X-API-KEY`** —
gets the files. The API key requires a one-time **ID.me** verification of the USPTO.gov
account (account.uspto.gov/profile#idverification).

## Run
```
export USPTO_API_KEY=...        # or write it to .apikey (gitignored)
.venv/bin/python download_backfill.py
```
Resume-safe (skips completed files, verifies PK zip magic). Endpoint shapes in
`download_backfill.py` are best-effort per ODP docs; confirm against the live key.