querystringobbligatorio
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.
Il tuo output apparirà qui
Completa gli input, poi fai clic su Esegui.
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.
Inizia a costruire
Endpoint API della piattaforma con autenticazione unificata e tracciamento dell'utilizzo.
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"
}'Imposta la tua SandBase API key nell'ambiente del server. Le richieste usano l'autenticazione Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Conserva la tua key sul server. Non esporla nel codice del browser.
querystringobbligatorioLocation name or query to search for (e.g., 'Istanbul', 'London', 'New York')
Risposta di esempio salvata per questa API; durante la visualizzazione non viene eseguita alcuna richiesta live.
Nessuna risposta salvata è stata pubblicata. Esegui l'API in Playground per ispezionarne la risposta.
Esplora altro
| API | Prezzo | Risposta |
|---|---|---|
AccuWeather Search LocationsQuesta API AccuWeather | $0.01 per chiamata | JSON asincrono |
AccuWeather | $0.01 per chiamata | JSON asincrono |
AccuWeather | $0.05 per chiamata | JSON asincrono |
Domande
Invia una richiesta POST a https://api.sandbase.ai/v1/api/accuweather/search-locations con la tua chiave API di SandBase nell'header Authorization (Bearer) e i parametri nel body JSON. Puoi anche provarla nel Playground di questa pagina senza scrivere codice.
$0.01 per chiamata, addebitato dal tuo saldo SandBase. Paghi solo le chiamate che effettui; non c'è alcun abbonamento.
Richiesti: query (string). La tabella dei parametri e il Playground di questa pagina elencano tutti i campi.
Un risultato JSON. Questo endpoint viene eseguito in modo asincrono, quindi la risposta indica come recuperare il risultato completato. Il README di questa pagina include una risposta di esempio.
No. AccuWeather Search Locations funziona tramite SandBase, quindi una sola chiave API SandBase copre questo endpoint e tutte le altre API e modelli del catalogo. Non è necessario richiedere separatamente l'accesso alle API AccuWeather.