Overview
API reference
Serpwire answers Google searches over HTTP. Every type is a POST to one path with a JSON body, and every response is JSON in serper.dev's shape plus two keys: searchParameters (the normalized request) and credits (what the call cost).
https://serp-api.ozymoz.comcurl -X POST 'https://serp-api.ozymoz.com/search' \
-H 'X-API-KEY: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"q": "best espresso machine",
"gl": "us",
"hl": "en"
}'Authentication#
Send your API key in the X-API-KEY header — the same header serper uses. Authorization: Bearer YOUR_API_KEY is accepted too. Create and delete keys in the dashboard; a key is shown once, when it is created.
X-API-KEY: YOUR_API_KEY
Content-Type: application/jsonErrors#
Errors share one shape and a stable code. The message is human text; branch on the code.
{
"error": {
"code": "insufficient_credits",
"message": "This request costs 3 credits; the balance is 1."
}
}| HTTP | Code | When |
|---|---|---|
| 400 | invalid_request | Validation failed — the message names the field. |
| 401 | invalid_api_key | Missing or unknown API key. |
| 401 | unauthorized | Missing or expired dashboard session. |
| 402 | insufficient_credits | Balance is lower than the cost of the request (or batch). |
| 403 | forbidden | Admin-only route. |
| 409 | email_taken | Sign-up with an email that already has an account. |
| 429 | rate_limited | Too many requests for this key — default 10 per second. |
| 500 | upstream_failed | Google answered something unusable after retries. Not billed. |
| 503 | no_capacity | No healthy Google session in time. Not billed — retry shortly. |
Batch requests#
Send an array of up to 100 request objects instead of one. The response is an array in the same order. Each item is billed separately, and the whole batch is checked against your balance up front (402 if it is short). A failed item sits in its place as an error object with credits 0 and the response is still 200; only when every item fails does the response take the first item's error status.
curl -X POST 'https://serp-api.ozymoz.com/search' \
-H 'X-API-KEY: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '[
{
"q": "apple",
"gl": "us"
},
{
"q": "elma",
"gl": "tr",
"hl": "tr"
}
]'[
{
"searchParameters": {
"q": "apple",
"gl": "us",
"type": "search",
"engine": "google"
},
"organic": [
"…"
],
"credits": 1
},
{
"error": {
"code": "upstream_failed",
"message": "Google answered something unusable."
},
"credits": 0
}
]Rate limits#
Each API key may send up to 10 requests per second by default. Over that you get 429 rate_limited — back off briefly and retry. Ask us if you need a higher limit.
Credits & billing#
Credits are deducted only for a successful (2xx) answer; a failed call costs 0. Each response reports its cost in credits.
Endpoints
- Search1 crOrganic results, knowledge graph, People also ask and related searches.
- Images1 crImage results with full-size and thumbnail URLs and dimensions.
- Videos1 crVideo results with duration, channel, thumbnail and date.
- Places1 crThe local pack: businesses with address, rating, coordinates and cid.
- Maps3 crGoogle Maps results around a viewport, with opening hours and ids.
- Reviews1 crRecent reviews for a place, looked up by cid, fid or placeId.
- News1 crFresh articles with source, date, snippet and image.
- Shopping2 crProduct listings with price, merchant, rating and image.
- Lens3 crVisual matches for an image URL — Google Lens, as JSON.
- Scholar1 crPapers with authors, year, citation count and PDF links.
- Patents1 crPatent documents with dates, inventor, assignee and number.
- Autocomplete1 crThe suggestions Google offers while someone types.
- Webpage2 crAny URL as plain text plus its metadata and JSON-LD.