Getting started
Rate limits
The Free plan allows 1,000 requests a day and up to 10 a second per account. Paid plans are coming soon.
Free plan
- Limits are per account, shared by all its keys and MCP connections. The daily count resets at midnight UTC.
- Every response carries
RateLimit-Limit,RateLimit-RemainingandRateLimit-Resetheaders. Once limits are enforced, a request over them gets429withRetry-After. - PatentsView-compatible routes return up to 1,000 rows per request (
o.size), so large exports need fewer calls. - Paid plans are coming soon, starting with Developer at $50 a month. Join the waitlist from your account's plan page.
The Try it panels in these docs use a shared demo key, limited to 10 requests a minute per visitor.
Retrying
Every route only reads, so retrying is always safe. Retry 429, 502, 503 and 504 after a short wait, doubling it each time. Don't retry 400, 401 or 404: the same request will fail the same way.
import os, time, requests
RETRY = {429, 502, 503, 504}
def search(params, attempts=4):
for attempt in range(attempts):
resp = requests.get(
"https://api.patentgrep.com/v1/search",
headers={"X-Api-Key": os.environ["PATENTGREP_KEY"]},
params=params,
)
if resp.status_code not in RETRY:
resp.raise_for_status()
return resp.json()
time.sleep(0.5 * 2**attempt)
resp.raise_for_status()