Sand AISand AI MAGI-2MAGI-2 теперь на SandBase: видео 1080p с нативным звукомПопробовать сейчас

AccuWeather List Cities

Документация API
https://api.sandbase.ai/v1/api/accuweather/list-cities

List all provinces or major administrative divisions within a country by its ISO 2-letter code. Searches across regional browse pages to find the country.

Цена
$0.01USD / вызов
Метод
POST
Ответ
Асинхронный JSON
Параметры
1 обязательных · 0 необязательных

Песочница

Ввод
ISO 2-letter country code, case-insensitive (e.g., 'tr', 'us', 'gb')
ВыходГотово

Ваш результат появится здесь

Заполните входные данные, затем нажмите «Запустить».

README по API

AccuWeather List Cities

Returns the provinces or major administrative divisions of a country on AccuWeather. You send an ISO 2-letter country code in country_code, and each result has a name, a type, and an AccuWeather browse-page URL.

Use cases

  • List all US states to build a region picker for a weather app.
  • Collect the browse-page URLs for a country to map its administrative divisions on AccuWeather.
  • Check which divisions AccuWeather lists for a country before you search for a specific place.
  • Seed a location database with division names for a given country.

Request

curl -X POST "https://api.sandbase.ai/v1/api/accuweather/list-cities" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"country_code": "US"}'

The result is returned in outputs[0].data.

Parameters

NameTypeRequiredDescription
country_codestringYesISO 2-letter country code, case-insensitive (e.g., 'tr', 'us', 'gb')

Example response

Real response for the request above, trimmed: lists keep their first item and long strings are cut.

{
  "data": {
    "items": [
      {
        "name": "Alabama",
        "type": "Province/City",
        "url": "https://www.accuweather.com/en/browse-locations/eur/us/al"
      }
    ]
  },
  "status": "success"
}

Response fields

FieldMeaning
data.items[]One province or major administrative division in the country.
data.items[].nameName of the division, for example Alabama.
data.items[].typeKind of division. The sample shows Province/City for US states.
data.items[].urlAccuWeather browse-locations page for the division. The path ends with a short division code such as al or ak.
statusResult of the call. The sample shows success.

Notes

  • country_code is case-insensitive, so US and us give the same request.
  • The url values include the country code and a short division code in the path, for example /us/al.
  • To find a specific place, call AccuWeather Search Locations. To get conditions for a place, call AccuWeather Weather.
  • The request has no pagination parameters. The only input is country_code.

Pricing

$0.01 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.

Посмотреть больше

Связанные APIs

Все APIs
APIЦенаОтвет
AccuWeather$0.01 за запросАсинхронный JSON
AccuWeather$0.01 за запросАсинхронный JSON
AccuWeather$0.05 за запросАсинхронный JSON

Вопросы

FAQ

Как использовать API AccuWeather List Cities?

Отправьте POST-запрос на https://api.sandbase.ai/v1/api/accuweather/list-cities, указав ключ SandBase API в заголовке Authorization (Bearer), а параметры — в теле JSON. Вы также можете попробовать это в Playground на этой странице без написания кода.

Сколько стоит API AccuWeather List Cities?

$0.01 за вызов, списывается с баланса SandBase. Оплата взимается только за сделанные вызовы; подписка не требуется.

Какие параметры принимает API AccuWeather List Cities?

Обязательные: country_code (string). В таблице Parameters и в Playground на этой странице перечислены все поля.

Что возвращает API AccuWeather List Cities?

JSON-результат. Этот endpoint работает асинхронно, поэтому ответ подсказывает, как получить готовый результат. В README на этой странице приведен пример ответа.

Нужен ли мне аккаунт разработчика AccuWeather или API key?

Нет. AccuWeather List Cities работает через SandBase, поэтому один API key SandBase покрывает этот endpoint и все остальные API и модели в каталоге. Вам не нужно отдельно запрашивать доступ к API AccuWeather.