De snelste manier om een Google Search API te testen is vanuit je terminal. De voorbeelden gebruiken serp.cheap.
Basisverzoek
curl https://api.serp.cheap/v1/search \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"q": "best electric cars 2026", "gl": "us", "page": 1}'
Land- en tijdfilters
# Resultaten uit Brazilië, laatste 24 uur
curl https://api.serp.cheap/v1/search \
-H "X-API-Key: YOUR_KEY" -H "Content-Type: application/json" \
-d '{"q": "eleições", "gl": "br", "tbs": "qdr:d"}'
Bekijk alle opties in Google Search API-parameters.
Mooi weergeven en extraheren met jq
# Alleen de organische links
curl -s https://api.serp.cheap/v1/search \
-H "X-API-Key: YOUR_KEY" -H "Content-Type: application/json" \
-d '{"q": "serp api curl", "gl": "us"}' | jq -r '.organic[].link'
# Titel + link als TSV
... | jq -r '.organic[] | [.position, .title, .link] | @tsv'
# Wat heeft deze aanroep gekost?
... | jq '.stats'
Paginering
for p in 1 2 3; do
curl -s https://api.serp.cheap/v1/search \
-H "X-API-Key: YOUR_KEY" -H "Content-Type: application/json" \
-d "{\"q\": \"serp api\", \"page\": $p}" | jq -r '.organic[].link'
done
Bewaar je key in een environment-variabele (-H "X-API-Key: $SERP_KEY") in plaats van hem in scripts te plakken.
Volgende
-
Volledige gids: hoe gebruik je de Google Search API