Sand AISand AI MAGI-2ตอนนี้ MAGI-2 อยู่บน SandBase แล้ว: วิดีโอ 1080p พร้อมเสียงในตัวลองใช้เลย

AccuWeather List Cities

เอกสาร API
https://api.sandbase.ai/v1/api/accuweather/list-cities

List all provinces or major administrative divisions within a country by its ISO 2-letter code. Searches across regional browse pages to find the country.

ราคา
$0.01USD / คำขอ
Method
POST
การตอบกลับ
Async JSON
พารามิเตอร์
1 จำเป็น · 0 ไม่บังคับ

Playground

อินพุต
ISO 2-letter country code, case-insensitive (e.g., 'tr', 'us', 'gb')
เอาต์พุตพร้อมใช้งาน

เอาต์พุตของคุณจะแสดงที่นี่

กรอกอินพุตให้ครบ แล้วคลิก Run

API README

AccuWeather List Cities

Returns the provinces or major administrative divisions of a country on AccuWeather. You send an ISO 2-letter country code in country_code, and each result has a name, a type, and an AccuWeather browse-page URL.

Use cases

  • List all US states to build a region picker for a weather app.
  • Collect the browse-page URLs for a country to map its administrative divisions on AccuWeather.
  • Check which divisions AccuWeather lists for a country before you search for a specific place.
  • Seed a location database with division names for a given country.

Request

curl -X POST "https://api.sandbase.ai/v1/api/accuweather/list-cities" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"country_code": "US"}'

The result is returned in outputs[0].data.

Parameters

NameTypeRequiredDescription
country_codestringYesISO 2-letter country code, case-insensitive (e.g., 'tr', 'us', 'gb')

Example response

Real response for the request above, trimmed: lists keep their first item and long strings are cut.

{
  "data": {
    "items": [
      {
        "name": "Alabama",
        "type": "Province/City",
        "url": "https://www.accuweather.com/en/browse-locations/eur/us/al"
      }
    ]
  },
  "status": "success"
}

Response fields

FieldMeaning
data.items[]One province or major administrative division in the country.
data.items[].nameName of the division, for example Alabama.
data.items[].typeKind of division. The sample shows Province/City for US states.
data.items[].urlAccuWeather browse-locations page for the division. The path ends with a short division code such as al or ak.
statusResult of the call. The sample shows success.

Notes

  • country_code is case-insensitive, so US and us give the same request.
  • The url values include the country code and a short division code in the path, for example /us/al.
  • To find a specific place, call AccuWeather Search Locations. To get conditions for a place, call AccuWeather Weather.
  • The request has no pagination parameters. The only input is country_code.

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 ต่อการเรียกAsync JSON
AccuWeather$0.01 ต่อการเรียกAsync JSON
AccuWeather$0.05 ต่อการเรียกAsync JSON

คำถาม

คำถามที่พบบ่อย

ฉันจะใช้ AccuWeather List Cities API ได้อย่างไร?

ส่งคำขอ POST ไปที่ https://api.sandbase.ai/v1/api/accuweather/list-cities โดยใส่ SandBase API key ของคุณใน Authorization header (Bearer) และส่งพารามิเตอร์เป็น JSON body คุณยังสามารถลองใช้ได้ใน Playground บนหน้านี้โดยไม่ต้องเขียนโค้ด

AccuWeather List Cities API ราคาเท่าไร?

$0.01 ต่อครั้ง คิดจากยอดคงเหลือ SandBase ของคุณ คุณจะถูกเรียกเก็บเฉพาะคำขอที่คุณส่งเท่านั้น ไม่มีค่าสมาชิกรายเดือน

AccuWeather List Cities API รับพารามิเตอร์อะไรบ้าง?

ที่ต้องระบุ: country_code (string). ตาราง Parameters และ Playground ในหน้านี้แสดงทุกฟิลด์

AccuWeather List Cities API ส่งคืนอะไร?

ผลลัพธ์ JSON จุดเชื่อมต่อนี้ทำงานแบบอะซิงโครนัส ดังนั้นการตอบกลับจะบอกวิธีดึงผลลัพธ์ที่เสร็จแล้ว README บนหน้านี้มีตัวอย่างการตอบกลับ

ฉันจำเป็นต้องมีบัญชีนักพัฒนาหรือ API key ของ AccuWeather ไหม?

ไม่จำเป็น AccuWeather List Cities ทำงานผ่าน SandBase ดังนั้น SandBase API key เดียวครอบคลุม endpoint นี้และทุก API กับโมเดลอื่นในแค็ตตาล็อก คุณไม่ต้องสมัครขอสิทธิ์เข้าถึง AccuWeather API แยกต่างหาก