country_codestringerforderlich
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.
Ihre Ausgabe wird hier angezeigt
Vervollständigen Sie die Eingaben und klicken Sie dann auf Ausführen.
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.
Jetzt loslegen
Plattform-API-Endpunkt mit einheitlicher Authentifizierung und Nutzungsnachverfolgung.
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"
}'Legen Sie Ihren SandBase API-Schlüssel in Ihrer Serverumgebung fest. Anfragen verwenden Bearer-Authentifizierung.
export SANDBASE_API_KEY="YOUR_API_KEY"Bewahren Sie Ihren Schlüssel auf dem Server auf. Geben Sie ihn nicht in Browser-Code preis.
country_codestringerforderlichISO 2-letter country code, case-insensitive (e.g., 'tr', 'us', 'gb')
Gespeicherte Beispielantwort für diese API; beim Anzeigen wird keine Live-Anfrage gesendet.
Es wurde keine gespeicherte Antwort veröffentlicht. Führen Sie die API in Playground aus, um die Antwort zu prüfen.
Mehr entdecken
| API | Preis | Antwort |
|---|---|---|
AccuWeather List CitiesDiese API AccuWeather | $0.01 pro Aufruf | Asynchrones JSON |
AccuWeather | $0.01 pro Aufruf | Asynchrones JSON |
AccuWeather | $0.05 pro Aufruf | Asynchrones JSON |
Fragen
Senden Sie eine POST-Anfrage an https://api.sandbase.ai/v1/api/accuweather/list-cities mit Ihrem SandBase API-Schlüssel im Authorization-Header (Bearer) und den Parametern als JSON-Body. Sie können das auch ohne Code direkt auf dieser Seite im Playground testen.
$0.01 pro Aufruf, abgerechnet von Ihrem SandBase-Guthaben. Es werden nur die von Ihnen getätigten Aufrufe berechnet; es gibt kein Abo.
Erforderlich: country_code (string). Die Parametertabelle und der Playground auf dieser Seite listen jedes Feld auf.
Ein JSON-Ergebnis. Dieser Endpunkt läuft asynchron, daher zeigt die Antwort, wie Sie das fertige Ergebnis abrufen. Die README auf dieser Seite enthält eine Beispielantwort.
Nein. AccuWeather List Cities läuft über SandBase, daher deckt ein SandBase API-Schlüssel diesen Endpunkt und jede andere API sowie jedes Modell im Katalog ab. Sie müssen keinen separaten Zugang für AccuWeather API beantragen.