Sand AISand AI MAGI-2MAGI-2 artık SandBase'de: yerel sesli 1080p videoŞimdi deneyin

AccuWeather Search Locations

API dokümanları
https://api.sandbase.ai/v1/api/accuweather/search-locations

Search for location keys and metadata by query string. Returns matching cities with their AccuWeather location keys, geographic coordinates, timezone information, and available datasets.

Fiyat
$0.01USD / çağrı
Yöntem
POST
Yanıt
Asenkron JSON
Parametreler
1 gerekli · 0 isteğe bağlı

Oynatma Alanı

Girdi
Location name or query to search for (e.g., 'Istanbul', 'London', 'New York')
ÇıktıHazır

Çıktınız burada görünecek

Girdileri tamamlayın, ardından Çalıştır'a tıklayın.

API README

AccuWeather Search Locations

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.

Use cases

  • Convert a city name typed by a user into the location Key needed for other weather calls.
  • Tell apart places with the same name, such as London in the United Kingdom, Canada and the United States.
  • Get latitude, longitude and elevation for a city to place it on a map.
  • Check which data sets, such as air quality or alerts, exist for a location before you request them.

Request

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.

Parameters

NameTypeRequiredDescription
querystringYesLocation name or query to search for (e.g., 'Istanbul', 'London', 'New York')

Example response

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"
}

Response fields

FieldMeaning
data.items[].KeyThe location key for the match. Use this value to identify the place in other weather calls.
data.items[].EnglishName / data.items[].LocalizedNameThe name of the place in English and in the local form.
data.items[].TypeThe kind of place. In this response the value is City.
data.items[].Country.ID / data.items[].Country.EnglishNameThe country code and country name for the match.
data.items[].AdministrativeArea.EnglishName / data.items[].AdministrativeArea.IDThe state, province or similar region that contains the place, with its short ID.
data.items[].GeoPosition.Latitude / data.items[].GeoPosition.LongitudeThe coordinates of the location.
data.items[].GeoPosition.Elevation.Metric.Value / data.items[].GeoPosition.Elevation.Imperial.ValueThe 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.GmtOffsetThe IANA time zone name and the offset from GMT. IsDaylightSaving shows if daylight saving time is active.
data.items[].DataSetsA list of data sets available for the location, such as AirQualityCurrentConditions or Alerts.
data.items[].Rank / data.items[].PrimaryPostalCodeRank is a numeric rank for the match. PrimaryPostalCode is the main postal code of the place.

Notes

  • Pass the place name in query. The response can hold several places with the same name, so check Country and AdministrativeArea to pick the right one.
  • Location keys are strings, for example 328328. Keep them as strings.
  • Call AccuWeather Weather next to get weather for a location. Use AccuWeather List Cities to browse cities instead of searching by name.

Pricing

$0.01 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.

Daha fazlasını keşfedin

İlgili APIs

Tüm APIs
APIFiyatYanıt
AccuWeather$0.01 çağrı başınaAsenkron JSON
AccuWeather$0.01 çağrı başınaAsenkron JSON
AccuWeather$0.05 çağrı başınaAsenkron JSON

Sorular

SSS

AccuWeather Search Locations API'sini nasıl kullanırım?

SandBase API anahtarınızı Authorization başlığında (Bearer) ve parametreleri JSON gövdesi olarak ile https://api.sandbase.ai/v1/api/accuweather/search-locations adresine bir POST isteği gönderin. Ayrıca bu sayfadaki Playground’da kod yazmadan da deneyebilirsiniz.

AccuWeather Search Locations API'sinin fiyatı nedir?

çağrı başına $0.01, SandBase bakiyenizden tahsil edilir. Yalnızca yaptığınız çağrılar için ücretlendirilirsiniz; abonelik yoktur.

AccuWeather Search Locations API'si hangi parametreleri kabul eder?

Gerekli: query (string). Parametreler tablosu ve bu sayfadaki Playground, tüm alanları listeler.

AccuWeather Search Locations API'si ne döndürür?

Bir JSON sonucu. Bu uç nokta asenkron çalışır; bu nedenle yanıt, tamamlanan sonucu nasıl alacağınızı söyler. Bu sayfadaki README'de örnek bir yanıt yer alır.

Bir AccuWeather geliştirici hesabına veya API anahtarına ihtiyacım var mı?

Hayır. AccuWeather Search Locations, SandBase üzerinden çalışır; bu nedenle tek bir SandBase API anahtarı bu uç noktayı ve katalogdaki diğer tüm API'leri ve modelleri kapsar. AccuWeather API erişimi için ayrıca başvuru yapmanız gerekmez.