किसी Google Search API का परीक्षण करने का सबसे तेज़ तरीका आपके टर्मिनल से है। उदाहरण serp.cheap का उपयोग करते हैं।
बुनियादी अनुरोध
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}'
देश और समय फ़िल्टर
# Results from Brazil, last 24 hours
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"}'
Google Search API parameters में सभी विकल्प देखें।
jq के साथ प्रिटी-प्रिंट और एक्सट्रैक्ट करें
# Just the organic 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'
# Title + link as TSV
... | jq -r '.organic[] | [.position, .title, .link] | @tsv'
# What did this call cost?
... | jq '.stats'
पेजिनेशन
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
अपनी key को स्क्रिप्ट में चिपकाने के बजाय एक env वेरिएबल में रखें (-H "X-API-Key: $SERP_KEY")।
आगे
-
पूरी गाइड: how to use the Google Search API