Sand AISand AI MAGI-2MAGI-2 jest teraz na SandBase: wideo 1080p z natywnym dźwiękiemWypróbuj teraz

Weibo Region City List

Dokumentacja API
https://api.sandbase.ai/v1/api/weibo/web-v2/city-list

Returns a directory of provinces and cities on Weibo. Supports toggling a normalized data structure via the normalized parameter.

Cena
$0.001USD / wywołanie
Metoda
POST
Odpowiedź
JSON
Parametry
0 wymaganych · 1 opcjonalnych

Playground

Wejście
Whether to return normalized structure (default True)
WyjściePrzykład
Odpowiedźoutputs · 1.1 KB · 57 wierszy
[
  {
    "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"
      ]
    }
  }
]

Przykłady

Wybierz przykład, aby wczytać jego dane wejściowe i wynik do playgroundu.

README API

Weibo Region City List API

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.

Use cases

  • Fill a province and city dropdown in a tool that filters Weibo data by region.
  • Match region codes found in Weibo user data to province and city names.
  • Build a lookup table from region code values to Chinese place names.
  • Check that a city name is spelled the way Weibo spells it before you use it in a query.

Request

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.

Parameters

NameTypeRequiredDescription
normalizedbooleanNoWhether to return normalized structure (default True)

Example response

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": "省/直辖市"
    }
  ]
}

Response fields

FieldMeaning
provinces[]One entry for each province or municipality. Each entry holds its own code and name and a list of cities.
provinces[].codeNumeric code of the province or municipality. For example, 34 is 安徽 and 11 is 北京.
provinces[].nameProvince or municipality name in Chinese.
provinces[].cities[]The cities or districts that belong to this province.
provinces[].cities[].codeNumeric 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[].nameCity or district name in Chinese, such as 合肥 or 东城区.

Notes

  • The first province entry has 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.
  • City code values are only unique inside one province. Keep the province code together with the city code when you store a location.
  • The normalized parameter defaults to true. The request in this example sent {}, so it used the default.

Pricing

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

Odkryj więcej

Powiązane APIs

Wszystkie APIs
APICenaOdpowiedź
Weibo$0.001 za wywołanieJSON
Weibo$0.001 za wywołanieJSON
Weibo$0.001 za wywołanieJSON
Weibo$0.001 za wywołanieJSON
Weibo$0.001 za wywołanieJSON
Weibo$0.001 za wywołanieJSON

Przewodniki:Best Weibo API in 2026: Pricing Compared

Pytania

FAQ

Jak używać API Weibo Region City List?

Wyślij żądanie POST do https://api.sandbase.ai/v1/api/weibo/web-v2/city-list z kluczem API SandBase w nagłówku Authorization (Bearer) oraz parametrami w treści JSON. Możesz też wypróbować je w Playground na tej stronie bez pisania kodu.

Ile kosztuje API Weibo Region City List?

$0.001 za wywołanie, rozliczane z salda SandBase. Płacisz tylko za wykonane wywołania; nie ma subskrypcji.

Jakie parametry przyjmuje API Weibo Region City List?

Nie są wymagane żadne parametry. Opcjonalne: normalized (boolean). Tabela Parameters oraz Playground na tej stronie zawierają wszystkie pola.

Co zwraca API Weibo Region City List?

Odpowiedź JSON zwrócona w tym samym żądaniu HTTP (synchronicznie). README na tej stronie zawiera przykładową odpowiedź.

Czy potrzebuję konta deweloperskiego Weibo lub klucza API?

Nie. Weibo Region City List działa przez SandBase, więc jeden klucz API SandBase obejmuje ten endpoint i każde inne API oraz model w katalogu. Nie musisz osobno ubiegać się o dostęp do API Weibo.