querystringerforderlich
Location name or query to search for (e.g., 'Istanbul', 'London', 'New York')
https://api.sandbase.ai/v1/api/accuweather/search-locationsSearch for location keys and metadata by query string. Returns matching cities with their AccuWeather location keys, geographic coordinates, timezone information, and available datasets.
Ihre Ausgabe wird hier angezeigt
Vervollständigen Sie die Eingaben und klicken Sie dann auf Ausführen.
This API searches AccuWeather locations by name and returns matching places. Each match includes its location Key, coordinates, time zone, and the data sets available for it. It needs one input: a query string such as London.
Key needed for other weather calls.curl -X POST "https://api.sandbase.ai/v1/api/accuweather/search-locations" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "London"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
query | string | Yes | Location name or query to search for (e.g., 'Istanbul', 'London', 'New York') |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"data": {
"items": [
{
"AdministrativeArea": {
"CountryID": "GB",
"EnglishName": "London",
"EnglishType": "London Borough",
"ID": "LND",
"Level": 1,
"LocalizedName": "London",
"LocalizedType": "London Borough"
},
"Country": {
"EnglishName": "United Kingdom",
"ID": "GB",
"LocalizedName": "United Kingdom"
},
"DataSets": [
"AirQualityCurrentConditions"
],
"EnglishName": "London",
"GeoPosition": {
"Elevation": {
"Imperial": {
"Unit": "ft",
"UnitType": 0,
"Value": 59
},
"Metric": {
"Unit": "m",
"UnitType": 5,
"Value": 18
}
},
"Latitude": 51.514,
"Longitude": -0.107
},
"IsAlias": false,
"Key": "328328",
"LocalizedName": "London",
"PrimaryPostalCode": "EC4A 2",
"Rank": 10,
"Region": {
"EnglishName": "Europe",
"ID": "EUR",
"LocalizedName": "Europe"
},
"SupplementalAdminAreas": [
{
"EnglishName": "England",
"Level": 0,
"LocalizedName": "England"
}
]
}
]
},
"status": "success"
}
| Field | Meaning |
|---|---|
data.items[].Key | The location key for the match. Use this value to identify the place in other weather calls. |
data.items[].EnglishName / data.items[].LocalizedName | The name of the place in English and in the local form. |
data.items[].Type | The kind of place. In this response the value is City. |
data.items[].Country.ID / data.items[].Country.EnglishName | The country code and country name for the match. |
data.items[].AdministrativeArea.EnglishName / data.items[].AdministrativeArea.ID | The state, province or similar region that contains the place, with its short ID. |
data.items[].GeoPosition.Latitude / data.items[].GeoPosition.Longitude | The coordinates of the location. |
data.items[].GeoPosition.Elevation.Metric.Value / data.items[].GeoPosition.Elevation.Imperial.Value | The elevation of the location. The metric value is in m and the imperial value is in ft, as given by the Unit field next to each. |
data.items[].TimeZone.Name / data.items[].TimeZone.GmtOffset | The IANA time zone name and the offset from GMT. IsDaylightSaving shows if daylight saving time is active. |
data.items[].DataSets | A list of data sets available for the location, such as AirQualityCurrentConditions or Alerts. |
data.items[].Rank / data.items[].PrimaryPostalCode | Rank is a numeric rank for the match. PrimaryPostalCode is the main postal code of the place. |
query. The response can hold several places with the same name, so check Country and AdministrativeArea to pick the right one.328328. Keep them as strings.$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/search-locations" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "London"
}'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.
querystringerforderlichLocation name or query to search for (e.g., 'Istanbul', 'London', 'New York')
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 Search LocationsDiese 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/search-locations 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: query (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 Search Locations 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.