querystringобязательно
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.
Ваш результат появится здесь
Заполните входные данные, затем нажмите «Запустить».
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.
Начните разработку
Конечная точка платформенного API с единообразной аутентификацией и учётом использования.
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"
}'Укажите свой ключ SandBase API в окружении сервера. Запросы используют аутентификацию Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Храните ключ на сервере. Не раскрывайте его в коде браузера.
querystringобязательноLocation name or query to search for (e.g., 'Istanbul', 'London', 'New York')
Сохранённый пример ответа для этого API; при просмотре живой запрос не выполняется.
Сохранённый ответ не опубликован. Запустите API в Playground, чтобы посмотреть его ответ.
Посмотреть больше
| API | Цена | Ответ |
|---|---|---|
AccuWeather Search LocationsЭтот API AccuWeather | $0.01 за запрос | Асинхронный JSON |
AccuWeather | $0.01 за запрос | Асинхронный JSON |
AccuWeather | $0.05 за запрос | Асинхронный JSON |
Вопросы
Отправьте POST-запрос на https://api.sandbase.ai/v1/api/accuweather/search-locations, указав ключ SandBase API в заголовке Authorization (Bearer), а параметры — в теле JSON. Вы также можете попробовать это в Playground на этой странице без написания кода.
$0.01 за вызов, списывается с баланса SandBase. Оплата взимается только за сделанные вызовы; подписка не требуется.
Обязательные: query (string). В таблице Parameters и в Playground на этой странице перечислены все поля.
JSON-результат. Этот endpoint работает асинхронно, поэтому ответ подсказывает, как получить готовый результат. В README на этой странице приведен пример ответа.
Нет. AccuWeather Search Locations работает через SandBase, поэтому один API key SandBase покрывает этот endpoint и все остальные API и модели в каталоге. Вам не нужно отдельно запрашивать доступ к API AccuWeather.