country_codestringrequerido
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.
Su salida aparecerá aquí
Complete las entradas y luego haga clic en Ejecutar.
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.
Empiece a construir
Endpoint de la API de la plataforma con autenticación unificada y seguimiento de uso.
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"
}'Configure su clave de API de SandBase en el entorno de su servidor. Las solicitudes usan autenticación Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Conserve su clave en el servidor. No la exponga en código del navegador.
country_codestringrequeridoISO 2-letter country code, case-insensitive (e.g., 'tr', 'us', 'gb')
Respuesta de ejemplo guardada para esta API; no se realiza ninguna solicitud en vivo al verla.
No se ha publicado ninguna respuesta guardada. Ejecute la API en Playground para inspeccionar su respuesta.
Explorar más
| API | Precio | Respuesta |
|---|---|---|
AccuWeather List CitiesEsta API AccuWeather | $0.01 por llamada | JSON asíncrono |
AccuWeather | $0.01 por llamada | JSON asíncrono |
AccuWeather | $0.05 por llamada | JSON asíncrono |
Preguntas
Envía una solicitud POST a https://api.sandbase.ai/v1/api/accuweather/list-cities con tu clave API de SandBase en el encabezado Authorization (Bearer) y los parámetros como un cuerpo JSON. También puedes probarlo en el Playground de esta página sin escribir código.
$0.01 por llamada, facturado desde tu saldo de SandBase. Solo se te cobra por las llamadas que haces; no hay suscripción.
Requeridos: country_code (string). La tabla de Parámetros y el Playground de esta página enumeran todos los campos.
Un resultado JSON. Este endpoint se ejecuta de forma asíncrona, así que la respuesta indica cómo obtener el resultado final. El README de esta página incluye una respuesta de ejemplo.
No. AccuWeather List Cities funciona a través de SandBase, así que una sola clave API de SandBase cubre este endpoint y todas las demás APIs y modelos del catálogo. No necesitas solicitar acceso a la API de AccuWeather por separado.