Sand AISand AI MAGI-2MAGI-2 agora está na SandBase: vídeo em 1080p com áudio nativoExperimente agora

AccuWeather List Cities

Docs da 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.

Preço
$0.01USD / chamada
Método
POST
Resposta
JSON assíncrono
Parâmetros
1 obrigatórios · 0 opcionais

Playground

Entrada
ISO 2-letter country code, case-insensitive (e.g., 'tr', 'us', 'gb')
SaídaPronto

Sua saída aparecerá aqui

Preencha as entradas e clique em Executar.

README da API

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.

Explorar mais

APIs relacionadas

Todas as APIs
APIPreçoResposta
AccuWeather$0.01 por chamadaJSON assíncrono
AccuWeather$0.01 por chamadaJSON assíncrono
AccuWeather$0.05 por chamadaJSON assíncrono

Perguntas

FAQ

Como eu uso a API AccuWeather List Cities?

Envie uma solicitação POST para https://api.sandbase.ai/v1/api/accuweather/list-cities com sua chave de API da SandBase no cabeçalho Authorization (Bearer) e os parâmetros no corpo JSON. Você também pode testar no Playground desta página sem escrever código.

Quanto custa a API AccuWeather List Cities?

$0.01 por chamada, cobrado do seu saldo SandBase. Você paga apenas pelas chamadas que fizer; não há assinatura.

Quais parâmetros a API AccuWeather List Cities aceita?

Obrigatórios: country_code (string). A tabela de Parâmetros e o Playground nesta página listam todos os campos.

O que a API AccuWeather List Cities retorna?

Um resultado JSON. Este endpoint é assíncrono, então a resposta informa como buscar o resultado final. O README desta página inclui um exemplo de resposta.

Preciso de uma conta de desenvolvedor AccuWeather ou de uma chave de API?

Não. AccuWeather List Cities funciona via SandBase, então uma única chave de API da SandBase cobre este endpoint e todas as outras APIs e modelos do catálogo. Você não precisa solicitar acesso à API do AccuWeather separadamente.