أسرع طريقة لاختبار واجهة بحث Google هي من الطرفية لديك. تستخدم الأمثلة 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.
التنسيق والاستخراج باستخدام 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
احتفظ بمفتاحك في متغيّر بيئة (-H "X-API-Key: $SERP_KEY") بدلاً من لصقه داخل النصوص البرمجية.
التالي
-
الدليل الكامل: كيفية استخدام واجهة بحث Google