Sand AISand AI MAGI-2MAGI-2 が SandBase に登場しました: ネイティブ音声付き 1080p 動画今すぐ試す

AccuWeather Search Locations

APIドキュメント
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.

料金
$0.01USD / 回
メソッド
POST
レスポンス
非同期 JSON
パラメータ
必須 1 件 · 任意 0 件

プレイグラウンド

入力
Location name or query to search for (e.g., 'Istanbul', 'London', 'New York')
出力準備完了

出力はここに表示されます

入力を完了してから[実行]をクリックしてください。

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.

さらに探索

関連 APIs

すべての APIs
API価格レスポンス
AccuWeather$0.01 / 回非同期 JSON
AccuWeather$0.01 / 回非同期 JSON
AccuWeather$0.05 / 回非同期 JSON

質問

FAQ

AccuWeather Search Locations API はどのように使いますか?

Authorization ヘッダー(Bearer)に SandBase API key を指定し、パラメータを JSON ボディで送信して https://api.sandbase.ai/v1/api/accuweather/search-locations に POST リクエストを送ります。このページの Playground で、コードを書かずに試すこともできます。

AccuWeather Search Locations API の料金はいくらですか?

1回あたり $0.01、SandBase 残高から課金されます。課金対象はご利用分のみで、サブスクリプションはありません。

AccuWeather Search Locations API はどのパラメータを受け付けますか?

必須: query (string)。 このページの Parameters テーブルと Playground に、すべてのフィールドが一覧表示されています。

AccuWeather Search Locations API は何を返しますか?

JSON 結果です。このエンドポイントは非同期で実行されるため、レスポンスには完了した結果の取得方法が含まれます。 このページの README にサンプルレスポンスがあります。

AccuWeather の開発者アカウントまたは API key は必要ですか?

いいえ。AccuWeather Search Locations は SandBase 経由で動作するため、SandBase の API key 1つでこのエンドポイントと、カタログ内の他のすべての API とモデルを利用できます。AccuWeather の API アクセスを別途申請する必要はありません。