Getting started
Authentication
Every request needs your API key. Send it in the X-Api-Key header, the same header PatentsView uses. Authorization: Bearer <key> works too.
| Header | Value |
|---|---|
X-Api-Key | Your key. Use this one; it matches PatentsView. |
Authorization | Bearer followed by a space and your key. |
Both headers work on every route, including the PatentsView-compatible endpoints. A PatentsView key won't work here: ask for a patentgrep key in the Quickstart.
curl -G https://api.patentgrep.com/v1/search \
-H "X-Api-Key: $PATENTGREP_KEY" \
--data-urlencode "q=solid electrolyte"curl -G https://api.patentgrep.com/v1/search \
-H "Authorization: Bearer $PATENTGREP_KEY" \
--data-urlencode "q=solid electrolyte"Keep your key secret
- Call the API from your server, a script or an agent's tool, never from code that runs in a visitor's browser.
- Read the key from an environment variable or a secret store, not from source control.
- If a key leaks, reply to the email it came in and we'll replace it.
# Loaded by your app, never committed
PATENTGREP_KEY=paste-your-key-hereMissing or wrong key
Without a valid key the API answers 401 with a sentence in detail. Check that the header name is spelled exactly and that the key has no spaces or line breaks around it.
{
"detail": "Missing or wrong API token. Send it as `Authorization: Bearer <token>`."
}