Sand AISand AI MAGI-2MAGI-2 ist jetzt auf SandBase: 1080p-Video mit nativem AudioJetzt testen

AccuWeather List Cities

API-Dokumentation
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.

Preis
$0.01USD / Aufruf
Methode
POST
Antwort
Asynchrones JSON
Parameter
1 erforderlich · 0 optional

Playground

Eingabe
ISO 2-letter country code, case-insensitive (e.g., 'tr', 'us', 'gb')
AusgabeBereit

Ihre Ausgabe wird hier angezeigt

Vervollständigen Sie die Eingaben und klicken Sie dann auf Ausführen.

API-README

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.

Mehr entdecken

Verwandte APIs

Alle APIs
APIPreisAntwort
AccuWeather$0.01 pro AufrufAsynchrones JSON
AccuWeather$0.01 pro AufrufAsynchrones JSON
AccuWeather$0.05 pro AufrufAsynchrones JSON

Fragen

FAQ

Wie verwende ich die AccuWeather List Cities API?

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.

Was kostet die AccuWeather List Cities API?

$0.01 pro Aufruf, abgerechnet von Ihrem SandBase-Guthaben. Es werden nur die von Ihnen getätigten Aufrufe berechnet; es gibt kein Abo.

Welche Parameter akzeptiert die AccuWeather List Cities API?

Erforderlich: country_code (string). Die Parametertabelle und der Playground auf dieser Seite listen jedes Feld auf.

Was gibt die AccuWeather List Cities API zurück?

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.

Benötige ich ein AccuWeather-Entwicklerkonto oder einen API-Schlüssel?

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.