지역, 언어, 기기
Google은 같은 검색어라도 국가, 언어, 도시, 기기에 따라 다른 결과를 보여 줍니다. 네 가지 매개변수로 받을 결과를 고릅니다.
gl · hl · location · device
| 이름 | 설명 |
|---|---|
gl | 결과 국가(두 글자 코드): us, gb, de, jp… |
hl | 페이지 언어: en, de, ja, pt-BR… 같은 시장의 gl과 함께 쓰세요. |
location | 도시나 지역에서 검색한 것처럼 합니다(예: "Munich,Bavaria,Germany"). 모바일 결과에만 적용되며 이름은 GET /google/locations로 조회합니다. |
device | mobile(기본) 또는 pc. 두 레이아웃은 다르며 일부 블록은 한쪽에만 나옵니다. |
gl과 hl은 대부분의 Google 엔드포인트에, device와 location은 Google 웹 검색에 적용됩니다. 지원 여부는 각 엔드포인트의 매개변수 표에 있습니다. 가격은 바뀌지 않습니다.
BASH
curl -X POST https://api.serpbase.dev/google/search \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"q": "coffee shops", "gl": "de", "hl": "de", "location": "Munich,Bavaria,Germany"}'검색 위치
Google Search location 파라미터에 사용할 수 있는 값을 조회합니다. 결과의 canonical_name을 /google/search의 location으로 전달할 수 있습니다. 이 요청은 크레딧을 차감하지 않습니다.
GET
0 credits
/google/locations?q=munich&country_code=de&limit=5q(필수)는 지명 또는 표준 이름과 대소문자 구분 없이 일치합니다. country_code는 ISO 3166-1 alpha-2 코드로 필터링하고 limit은 1-100(기본 20)입니다. 정확히 일치하는 이름이 먼저, 그다음 넓은 지역 순입니다. 같은 이름의 지역이 많으므로(Paris, France와 Paris, Texas 등) country_code로 좁혀 주세요. 키는 X-API-Key 헤더로 전달하세요.
BASH
curl "https://api.serpbase.dev/google/locations?q=munich&country_code=de&limit=2" \
-H "X-API-Key: your_api_key"
curl -X POST https://api.serpbase.dev/google/search \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{"q":"crossfit software","gl":"de","hl":"de","device":"mobile","location":"Munich,Bavaria,Germany"}'JSON
{
"status": 0,
"locations": [
{
"canonical_name": "Munich,Bavaria,Germany",
"name": "Munich",
"country_code": "DE",
"target_type": "City"
},
{
"canonical_name": "Taufkirchen,Munich,Bavaria,Germany",
"name": "Taufkirchen",
"country_code": "DE",
"target_type": "City"
}
]
}| 국가(location 값) | gl | 도시 예시 |
|---|---|---|
| United States | us | New York,New York,United States |
| United Kingdom | gb | London,England,United Kingdom |
| Germany | de | Munich,Bavaria,Germany |
| Austria | at | Vienna,Vienna,Austria |
| Switzerland | ch | Zurich,Zurich,Switzerland |
| France | fr | Paris,Ile-de-France,France |
| Italy | it | Milan,Lombardy,Italy |
| Spain | es | Madrid,Community of Madrid,Spain |
| Poland | pl | Warsaw,Masovian Voivodeship,Poland |
| Canada | ca | Toronto,Ontario,Canada |
| Australia | au | Sydney,New South Wales,Australia |
| Japan | jp | Tokyo,Tokyo,Japan |
| Indonesia | id | Jakarta,Jakarta,Indonesia |
| Philippines | ph | Manila,Metro Manila,Philippines |
| Brazil | br | Sao Paulo,State of Sao Paulo,Brazil |
| Mexico | mx | Mexico City,Mexico City,Mexico |
계정당 분당 60회로 제한됩니다. 목록에 없는 location은 오류 없이 무시되고 location 없이 검색됩니다. location은 모바일 검색(device mobile, 기본값)에서만 적용됩니다.