Short answer: create a free account, copy the key from the API keys page of the dashboard, and send it in the X-API-Key header of every request. The account comes with 500 free credits and needs no card, so the key works straight away.
Getting the key
- Sign up at serpbase.dev/register.
- Open the API keys page in the dashboard and create a key. You can create several, name them, and revoke one without touching the others.
- Put it in the
X-API-Keyheader.
curl -X POST 'https://api.serpbase.dev/google/search' \
-H 'Content-Type: application/json' \
-H 'X-API-Key: YOUR_API_KEY' \
-d '{"q":"coffee","gl":"us","hl":"en"}'
The same key works on every endpoint: Google search, images, news, maps, YouTube, Amazon and the rest.
What a wrong key looks like
We ran these on 28 November 2026. All three answered HTTP 200 with a non-zero status, credits_charged 0 and the response header X-SerpBase-Retryable: false.
| What we sent | status | error |
|---|---|---|
| No key at all | 1001 | no API key presented; pass it in the X-API-Key header |
| A made-up key in the header | 1001 | invalid API key |
A key in the URL (?api_key=...) and no header | 1001 | no API key presented; pass it in the X-API-Key header |
The third row is the one people hit when moving from another provider: on the standard endpoints a key in the query string is not read at all. That is deliberate. Addresses end up in server logs, browser history and proxy logs; headers do not.
Check the key and the balance in one call
curl 'https://api.serpbase.dev/account/credits' \
-H 'X-API-Key: YOUR_API_KEY'
This costs 0 credits. In our test the answer had status 0 and four balance fields:
| Field | What it holds |
|---|---|
credits | Total credits you can spend now |
permanent_credits | Credits that do not expire on a date |
expiring_credits | Limited-time credits |
expiring_expires_at | Unix time when those expire; 0 when there are none |
Python: fail early on a bad key
import os, requests
API = "https://api.serpbase.dev"
HEADERS = {"X-API-Key": os.environ["SERPBASE_API_KEY"]}
me = requests.get(API + "/account/credits", headers=HEADERS, timeout=30).json()
if me["status"] != 0:
raise SystemExit("key problem: " + me.get("error", "unknown"))
print("credits left:", me["credits"])
r = requests.post(
API + "/google/search",
headers=HEADERS,
json={"q": "coffee", "gl": "us", "hl": "en"},
timeout=60,
).json()
if r["status"] == 0:
print(r["organic"][0]["title"])
else:
print("search failed:", r["status"], r.get("error"))
Things that trip people up
- An HTTP 200 is not a success. Every row in the table above was a 200. Read
status:0is success,1001is a key problem,1020is an empty balance. - Do not retry a
1001. TheX-SerpBase-Retryable: falseheader says the request itself has to change. - Keep the key out of code. Read it from an environment variable, as the script does, and never commit it. If a key leaks, revoke it in the dashboard and create another.
- Do not call the API from a web page. Anyone can read a key shipped to the browser. Call from your server and pass the results on.
- More keys do not mean more speed. All keys on an account share one requests-per-second limit.
- The balance endpoint has its own limit. The docs put it at 60 requests a minute per account. Check before a batch, not before every search.
What the free credits cover
A Google search is 1 credit, so 500 credits is 500 searches. More on what you get before paying is in Is there a free Google search API?
Cost and limits
After the free credits, credits cost $0.25–$0.50 per 1,000 depending on the plan. Failed requests are not charged.
- Keys, limits and the balance endpoint: API keys docs
- Every status code: responses and errors
- First request step by step: quickstart
- Credit packs: pricing