The fastest way to test a Google Search API is from your terminal. Examples use serp.cheap.
Basic request
Put your key in an env var once, then every example below is copy-paste:
export SERP_KEY="your-api-key"
curl https://api.serp.cheap/v1/search \
-H "X-API-Key: $SERP_KEY" \
-H "Content-Type: application/json" \
-d '{"q": "best electric cars 2026", "gl": "us", "page": 1}'
Response (trimmed to the first two organic results — a full page returns more, plus knowledgeGraph when Google shows one):
{
"search": "best electric cars 2026",
"page": 1,
"organic": [
{
"position": 1,
"title": "Best Electric Cars of 2026 - Car and Driver",
"link": "https://www.caranddriver.com/rankings/best-electric-cars/",
"snippet": "Our editors test and rank the EVs worth buying in 2026, from budget hatchbacks to long-range sedans...",
"date": "Jun 2, 2026"
},
{
"position": 2,
"title": "Top Electric Cars for 2026 | Edmunds",
"link": "https://www.edmunds.com/electric-car/best-electric-cars/",
"snippet": "The best electric cars balance range, charging speed and price. Here are our top picks..."
}
],
"stats": { "balance": 9994, "cost": 6, "cached": false }
}
stats.cost is in credits: 6 for a fresh fetch ($0.0006), 3 for a cache hit ($0.0003).
Country and time filters
# Results from Brazil, last 24 hours
curl https://api.serp.cheap/v1/search \
-H "X-API-Key: $SERP_KEY" -H "Content-Type: application/json" \
-d '{"q": "eleições", "gl": "br", "tbs": "qdr:d"}'
See all options in Google Search API parameters.
Pretty-print and extract with jq
# Just the organic links
curl -s https://api.serp.cheap/v1/search \
-H "X-API-Key: $SERP_KEY" -H "Content-Type: application/json" \
-d '{"q": "serp api curl", "gl": "us"}' | jq -r '.organic[].link'
# Fetch once, slice many ways
resp=$(curl -s https://api.serp.cheap/v1/search \
-H "X-API-Key: $SERP_KEY" -H "Content-Type: application/json" \
-d '{"q": "serp api curl", "gl": "us"}')
# Position + title + link as TSV
echo "$resp" | jq -r '.organic[] | [.position, .title, .link] | @tsv'
# What did this call cost?
echo "$resp" | jq '.stats'
Pagination
for p in 1 2 3; do
curl -s https://api.serp.cheap/v1/search \
-H "X-API-Key: $SERP_KEY" -H "Content-Type: application/json" \
-d "{\"q\": \"serp api\", \"page\": $p}" | jq -r '.organic[].link'
done
page is 1-indexed. Keep your key in the env var rather than pasting it into scripts or shell history.
Next
- Full guide: how to use the Google Search API
- In code: Python · Node.js
Try serp.cheap
Every snippet above runs as-is once you export your key. 100 free searches on signup — no card required; pay-as-you-go from $0.75/1k after that, and credits stay valid for 12 months.
- Get your free API key →
- Prefer paying by card? serp.cheap is also on RapidAPI (
$0.90/1k) and Apify ($1.50/1k).