[object Object]

← back to Uspto Trtyrap

Point downloader at api.uspto.gov (UI host is not for API use)

e36cdff86383a1bdad162f09efe7dab64ff81fe0 · 2026-08-06 16:05:11 -0700 · Steve

Files touched

Diff

commit e36cdff86383a1bdad162f09efe7dab64ff81fe0
Author: Steve <steve@designerwallcoverings.com>
Date:   Thu Aug 6 16:05:11 2026 -0700

    Point downloader at api.uspto.gov (UI host is not for API use)
---
 .apikey              | 1 -
 download_backfill.py | 6 +++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/.apikey b/.apikey
deleted file mode 100644
index 09785c6..0000000
--- a/.apikey
+++ /dev/null
@@ -1 +0,0 @@
-read_assigned_fulfillment_orders
\ No newline at end of file
diff --git a/download_backfill.py b/download_backfill.py
index f4d9bf1..6ff610d 100644
--- a/download_backfill.py
+++ b/download_backfill.py
@@ -38,8 +38,8 @@ def api_get(url, key, **kw):
 def list_files(key):
     # Primary ODP bulk-data product endpoint (returns file bag w/ download URIs).
     candidates = [
-        f"https://data.uspto.gov/api/v1/datasets/products/{PRODUCT}?fileDataFromDate={FROM}&fileDataToDate={TO}",
-        f"https://data.uspto.gov/api/v1/datasets/products/{PRODUCT}",
+        f"https://api.uspto.gov/api/v1/datasets/products/{PRODUCT}?fileDataFromDate={FROM}&fileDataToDate={TO}",
+        f"https://api.uspto.gov/api/v1/datasets/products/{PRODUCT}",
     ]
     for url in candidates:
         r = api_get(url, key)
@@ -69,7 +69,7 @@ def download(f, key):
     if dest.exists() and size and dest.stat().st_size == int(size):
         return dest.stat().st_size, "skip"
     if not uri:
-        uri = f"https://data.uspto.gov/api/v1/datasets/products/{PRODUCT}/files/{name}"
+        uri = f"https://api.uspto.gov/api/v1/datasets/products/{PRODUCT}/files/{name}"
     h = {"X-API-KEY": key, "Accept": "application/zip,application/octet-stream,*/*"}
     with requests.get(uri, headers=h, impersonate="chrome", timeout=1800, stream=True) as r:
         if r.status_code != 200 or "html" in (r.headers.get("content-type") or ""):

← feb6987 auto-data-snapshot: 2026-08-06T16:03:07 (1 data files) — .ap  ·  back to Uspto Trtyrap  ·  add TRTYRAP trademark XML parser -> searchable SQLite (43,76 b660ef7 →