Available Cities

    Retrieve the list of cities for a given country. Used to get canonical_name for Google geo-targeting and yandex_lr codes for Yandex geo-targeting.

    Endpoint

    GET /api/parsing/geo/countries/{countryCode}

    Path Parameters

    NameTypeRequiredDescription
    countryCodestringyesISO country code (e.g. US, GB)

    Example Request

    curl https://app.scrapering.com/api/parsing/geo/countries/US \
      --header 'Authorization: Bearer YOUR_API_KEY'
    

    Example Response

    {
      "country_code": "US",
      "cities": [
        {
          "name": "New York",
          "canonical_name": "New York,New York,United States",
          "yandex_lr": 202,
          "name_ru": "Нью-Йорк"
        },
        {
          "name": "Los Angeles",
          "canonical_name": "Los Angeles,California,United States",
          "yandex_lr": 20047,
          "name_ru": "Лос-Анджелес"
        },
        {
          "name": "Aaronsburg",
          "canonical_name": "Aaronsburg,Pennsylvania,United States",
          "yandex_lr": null,
          "name_ru": null
        }
      ]
    }
    

    Response Fields

    FieldTypeDescription
    country_codestringISO country code
    cities[].namestringCity name in English
    cities[].canonical_namestringFull location string for Google geo-targeting
    cities[].yandex_lrnumber | nullYandex region code for geo-targeting. null if not supported
    cities[].name_rustring | nullCity name in Russian. null if not available

    Using Location Data

    Google SERP — pass canonical_name as canonicalLocationName and country_code.toLowerCase() as gl:

    {
      "q": "pizza delivery",
      "count": 10,
      "gl": "us",
      "canonicalLocationName": "New York,New York,United States"
    }
    

    Yandex SERP — pass yandex_lr as region. Note: not all cities have a yandex_lr value.

    {
      "q": "pizza delivery",
      "count": 10,
      "region": 202
    }
    

    Next steps