country_codestringобязательно
ISO 2-letter country code, case-insensitive (e.g., 'tr', 'us', 'gb')
https://api.sandbase.ai/v1/api/accuweather/list-citiesList all provinces or major administrative divisions within a country by its ISO 2-letter code. Searches across regional browse pages to find the country.
Ваш результат появится здесь
Заполните входные данные, затем нажмите «Запустить».
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.
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.
| Name | Type | Required | Description |
|---|---|---|---|
country_code | string | Yes | ISO 2-letter country code, case-insensitive (e.g., 'tr', 'us', 'gb') |
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"
}
| Field | Meaning |
|---|---|
data.items[] | One province or major administrative division in the country. |
data.items[].name | Name of the division, for example Alabama. |
data.items[].type | Kind of division. The sample shows Province/City for US states. |
data.items[].url | AccuWeather browse-locations page for the division. The path ends with a short division code such as al or ak. |
status | Result of the call. The sample shows success. |
country_code is case-insensitive, so US and us give the same request.url values include the country code and a short division code in the path, for example /us/al.country_code.$0.01 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.
Начните разработку
Конечная точка платформенного API с единообразной аутентификацией и учётом использования.
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"
}'Укажите свой ключ SandBase API в окружении сервера. Запросы используют аутентификацию Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Храните ключ на сервере. Не раскрывайте его в коде браузера.
country_codestringобязательноISO 2-letter country code, case-insensitive (e.g., 'tr', 'us', 'gb')
Сохранённый пример ответа для этого API; при просмотре живой запрос не выполняется.
Сохранённый ответ не опубликован. Запустите API в Playground, чтобы посмотреть его ответ.
Посмотреть больше
| API | Цена | Ответ |
|---|---|---|
AccuWeather List CitiesЭтот API AccuWeather | $0.01 за запрос | Асинхронный JSON |
AccuWeather | $0.01 за запрос | Асинхронный JSON |
AccuWeather | $0.05 за запрос | Асинхронный JSON |
Вопросы
Отправьте POST-запрос на https://api.sandbase.ai/v1/api/accuweather/list-cities, указав ключ SandBase API в заголовке Authorization (Bearer), а параметры — в теле JSON. Вы также можете попробовать это в Playground на этой странице без написания кода.
$0.01 за вызов, списывается с баланса SandBase. Оплата взимается только за сделанные вызовы; подписка не требуется.
Обязательные: country_code (string). В таблице Parameters и в Playground на этой странице перечислены все поля.
JSON-результат. Этот endpoint работает асинхронно, поэтому ответ подсказывает, как получить готовый результат. В README на этой странице приведен пример ответа.
Нет. AccuWeather List Cities работает через SandBase, поэтому один API key SandBase покрывает этот endpoint и все остальные API и модели в каталоге. Вам не нужно отдельно запрашивать доступ к API AccuWeather.