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}'
국가 및 시간 필터
# 브라질 결과, 최근 24시간
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 파라미터에서 확인하세요.
jq로 보기 좋게 출력하고 추출하기
# organic 링크만
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'
# 제목 + 링크를 TSV로
... | jq -r '.organic[] | [.position, .title, .link] | @tsv'
# 이번 호출의 비용은?
... | 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 Search API 사용법