normalizedboolean
Whether to return normalized structure (default True)
ค่าเริ่มต้น: true
https://api.sandbase.ai/v1/api/weibo/web-v2/city-listReturns a directory of provinces and cities on Weibo. Supports toggling a normalized data structure via the normalized parameter.
[
{
"data": {
"provinces": [
{
"cities": [
{
"code": 0,
"name": "城市/地区"
}
],
"code": 0,
"name": "省/直辖市"
},
{
"cities": [
{
"code": 1,
"name": "合肥"
},
{
"code": 2,
"name": "芜湖"
},
{
"code": 3,
"name": "蚌埠"
},
"… 14 more items in the full response"
],
"code": 34,
"name": "安徽"
},
{
"cities": [
{
"code": 1,
"name": "东城区"
},
{
"code": 2,
"name": "西城区"
},
{
"code": 3,
"name": "崇文区"
},
"… 15 more items in the full response"
],
"code": 11,
"name": "北京"
},
"… 34 more items in the full response"
]
}
}
]เลือกตัวอย่างเพื่อโหลดอินพุตและผลลัพธ์ลงใน playground
Returns a list of provinces and the cities inside each one, as used on Weibo. Each entry has a numeric code and a Chinese name. The only input is the optional normalized boolean, so you can send an empty body.
code values to Chinese place names.curl -X POST "https://api.sandbase.ai/v1/api/weibo/web-v2/city-list" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
normalized | boolean | No | Whether to return normalized structure (default True) |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"provinces": [
{
"cities": [
{
"code": 0,
"name": "城市/地区"
}
],
"code": 0,
"name": "省/直辖市"
}
]
}
| Field | Meaning |
|---|---|
provinces[] | One entry for each province or municipality. Each entry holds its own code and name and a list of cities. |
provinces[].code | Numeric code of the province or municipality. For example, 34 is 安徽 and 11 is 北京. |
provinces[].name | Province or municipality name in Chinese. |
provinces[].cities[] | The cities or districts that belong to this province. |
provinces[].cities[].code | Numeric code of the city or district. The value counts up from 1 inside each province, so the same code can appear under different provinces. |
provinces[].cities[].name | City or district name in Chinese, such as 合肥 or 东城区. |
code 0 and the name 省/直辖市. Its only city has code 0 and the name 城市/地区. These look like placeholder labels for a dropdown, not real places.code values are only unique inside one province. Keep the province code together with the city code when you store a location.normalized parameter defaults to true. The request in this example sent {}, so it used the default.$0.001 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.
เริ่มสร้าง
เอ็นด์พอยต์ของ Platform API ที่มีการยืนยันตัวตนและการติดตามการใช้งานแบบรวมศูนย์
curl -X POST "https://api.sandbase.ai/v1/api/weibo/web-v2/city-list" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"normalized": true
}'ตั้งค่า SandBase API key ของคุณในสภาพแวดล้อมฝั่งเซิร์ฟเวอร์ คำขอจะใช้การยืนยันตัวตนแบบ Bearer
export SANDBASE_API_KEY="YOUR_API_KEY"เก็บ key ไว้บนเซิร์ฟเวอร์ อย่าเปิดเผยในโค้ดฝั่งเบราว์เซอร์
normalizedbooleanWhether to return normalized structure (default True)
ค่าเริ่มต้น: true
บันทึกตัวอย่างการตอบกลับสำหรับ API นี้; จะไม่มีการส่งคำขอจริงเมื่อเปิดดู
[
{
"data": {
"provinces": [
{
"cities": [
{
"code": 0,
"name": "城市/地区"
}
],
"code": 0,
"name": "省/直辖市"
},
{
"cities": [
{
"code": 1,
"name": "合肥"
},
{
"code": 2,
"name": "芜湖"
},
{
"code": 3,
"name": "蚌埠"
},
"… 14 more items in the full response"
],
"code": 34,
"name": "安徽"
},
{
"cities": [
{
"code": 1,
"name": "东城区"
},
{
"code": 2,
"name": "西城区"
},
{
"code": 3,
"name": "崇文区"
},
"… 15 more items in the full response"
],
"code": 11,
"name": "北京"
},
"… 34 more items in the full response"
]
}
}
]สำรวจเพิ่มเติม
| API | ราคา | การตอบกลับ |
|---|---|---|
Weibo Region City ListAPI นี้ Weibo | $0.001 ต่อการเรียก | JSON |
Weibo | $0.001 ต่อการเรียก | JSON |
Weibo | $0.001 ต่อการเรียก | JSON |
Weibo | $0.001 ต่อการเรียก | JSON |
Weibo | $0.001 ต่อการเรียก | JSON |
Weibo | $0.001 ต่อการเรียก | JSON |
คำถาม
ส่งคำขอ POST ไปที่ https://api.sandbase.ai/v1/api/weibo/web-v2/city-list โดยใส่ SandBase API key ของคุณใน Authorization header (Bearer) และส่งพารามิเตอร์เป็น JSON body คุณยังสามารถลองใช้ได้ใน Playground บนหน้านี้โดยไม่ต้องเขียนโค้ด
$0.001 ต่อครั้ง คิดจากยอดคงเหลือ SandBase ของคุณ คุณจะถูกเรียกเก็บเฉพาะคำขอที่คุณส่งเท่านั้น ไม่มีค่าสมาชิกรายเดือน
ไม่ต้องระบุพารามิเตอร์ ตัวเลือก: normalized (boolean). ตาราง Parameters และ Playground ในหน้านี้แสดงทุกฟิลด์
การตอบกลับ JSON ที่ส่งกลับในคำขอ HTTP เดียวกัน (แบบซิงโครนัส) README บนหน้านี้มีตัวอย่างการตอบกลับ
ไม่จำเป็น Weibo Region City List ทำงานผ่าน SandBase ดังนั้น SandBase API key เดียวครอบคลุม endpoint นี้และทุก API กับโมเดลอื่นในแค็ตตาล็อก คุณไม่ต้องสมัครขอสิทธิ์เข้าถึง Weibo API แยกต่างหาก