List Top Cities
curl --request POST \
--url https://api.aisa.one/apis/v1/accu-weather/list-top-cities \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"count": 50,
"details": false,
"language": "en-us",
"language_id": 1,
"ranking_scope": "global",
"region_code": "NAM"
}
'import requests
url = "https://api.aisa.one/apis/v1/accu-weather/list-top-cities"
payload = {
"count": 50,
"details": False,
"language": "en-us",
"language_id": 1,
"ranking_scope": "global",
"region_code": "NAM"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
count: 50,
details: false,
language: 'en-us',
language_id: 1,
ranking_scope: 'global',
region_code: 'NAM'
})
};
fetch('https://api.aisa.one/apis/v1/accu-weather/list-top-cities', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aisa.one/apis/v1/accu-weather/list-top-cities",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'count' => 50,
'details' => false,
'language' => 'en-us',
'language_id' => 1,
'ranking_scope' => 'global',
'region_code' => 'NAM'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/accu-weather/list-top-cities"
payload := strings.NewReader("{\n \"count\": 50,\n \"details\": false,\n \"language\": \"en-us\",\n \"language_id\": 1,\n \"ranking_scope\": \"global\",\n \"region_code\": \"NAM\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aisa.one/apis/v1/accu-weather/list-top-cities")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"count\": 50,\n \"details\": false,\n \"language\": \"en-us\",\n \"language_id\": 1,\n \"ranking_scope\": \"global\",\n \"region_code\": \"NAM\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/accu-weather/list-top-cities")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"count\": 50,\n \"details\": false,\n \"language\": \"en-us\",\n \"language_id\": 1,\n \"ranking_scope\": \"global\",\n \"region_code\": \"NAM\"\n}"
response = http.request(request)
puts response.read_body{
"cities": [
{
"administrative_area": {
"country_id": "<string>",
"english_name": "<string>",
"id": "<string>",
"level": 123,
"localized_name": "<string>",
"english_type": "<string>",
"localized_type": "<string>"
},
"country": {
"english_name": "<string>",
"id": "<string>",
"localized_name": "<string>"
},
"data_sets": [
"<string>"
],
"english_name": "<string>",
"geo_position": {
"elevation": {
"imperial": {
"unit": "<string>",
"unit_type": 123,
"value": 123
},
"metric": {
"unit": "<string>",
"unit_type": 123,
"value": 123
}
},
"latitude": 123,
"longitude": 123
},
"is_alias": true,
"key": "<string>",
"localized_name": "<string>",
"primary_postal_code": "<string>",
"rank": 123,
"region": {
"english_name": "<string>",
"id": "<string>",
"localized_name": "<string>"
},
"time_zone": {
"code": "<string>",
"gmt_offset": 123,
"is_daylight_saving": true,
"name": "<string>",
"next_offset_change": "<string>"
},
"type": "<string>",
"version": 123,
"details": {
"band_map": "<string>",
"canonical_location_key": "<string>",
"canonical_postal_code": "<string>",
"climo": "<string>",
"key": "<string>",
"local_radar": "<string>",
"location_stem": "<string>",
"marine_station": "<string>",
"marine_station_gmt_offset": 123,
"media_region": "<string>",
"metar": "<string>",
"nx_metro": "<string>",
"nx_state": "<string>",
"population": 1,
"primary_warning_county_code": "<string>",
"primary_warning_zone_code": "<string>",
"satellite": "<string>",
"station_code": "<string>",
"station_gmt_offset": 123,
"synoptic": "<string>",
"video_code": "<string>",
"dma": {
"english_name": "<string>",
"id": "<string>"
},
"partner_id": "<string>",
"sources": [
{
"data_type": "<string>",
"source": "<string>",
"source_id": 123,
"partner_source_url": "<string>"
}
]
},
"parent_city": {
"english_name": "<string>",
"key": "<string>",
"localized_name": "<string>"
},
"supplemental_admin_areas": [
{
"english_name": "<string>",
"level": 123,
"localized_name": "<string>"
}
]
}
]
}AccuWeather
List Top Cities
List Top Cities
POST
https://api.aisa.one
/
apis
/
v1
/
accu-weather
/
list-top-cities
List Top Cities
curl --request POST \
--url https://api.aisa.one/apis/v1/accu-weather/list-top-cities \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"count": 50,
"details": false,
"language": "en-us",
"language_id": 1,
"ranking_scope": "global",
"region_code": "NAM"
}
'import requests
url = "https://api.aisa.one/apis/v1/accu-weather/list-top-cities"
payload = {
"count": 50,
"details": False,
"language": "en-us",
"language_id": 1,
"ranking_scope": "global",
"region_code": "NAM"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
count: 50,
details: false,
language: 'en-us',
language_id: 1,
ranking_scope: 'global',
region_code: 'NAM'
})
};
fetch('https://api.aisa.one/apis/v1/accu-weather/list-top-cities', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aisa.one/apis/v1/accu-weather/list-top-cities",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'count' => 50,
'details' => false,
'language' => 'en-us',
'language_id' => 1,
'ranking_scope' => 'global',
'region_code' => 'NAM'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/accu-weather/list-top-cities"
payload := strings.NewReader("{\n \"count\": 50,\n \"details\": false,\n \"language\": \"en-us\",\n \"language_id\": 1,\n \"ranking_scope\": \"global\",\n \"region_code\": \"NAM\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aisa.one/apis/v1/accu-weather/list-top-cities")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"count\": 50,\n \"details\": false,\n \"language\": \"en-us\",\n \"language_id\": 1,\n \"ranking_scope\": \"global\",\n \"region_code\": \"NAM\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/accu-weather/list-top-cities")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"count\": 50,\n \"details\": false,\n \"language\": \"en-us\",\n \"language_id\": 1,\n \"ranking_scope\": \"global\",\n \"region_code\": \"NAM\"\n}"
response = http.request(request)
puts response.read_body{
"cities": [
{
"administrative_area": {
"country_id": "<string>",
"english_name": "<string>",
"id": "<string>",
"level": 123,
"localized_name": "<string>",
"english_type": "<string>",
"localized_type": "<string>"
},
"country": {
"english_name": "<string>",
"id": "<string>",
"localized_name": "<string>"
},
"data_sets": [
"<string>"
],
"english_name": "<string>",
"geo_position": {
"elevation": {
"imperial": {
"unit": "<string>",
"unit_type": 123,
"value": 123
},
"metric": {
"unit": "<string>",
"unit_type": 123,
"value": 123
}
},
"latitude": 123,
"longitude": 123
},
"is_alias": true,
"key": "<string>",
"localized_name": "<string>",
"primary_postal_code": "<string>",
"rank": 123,
"region": {
"english_name": "<string>",
"id": "<string>",
"localized_name": "<string>"
},
"time_zone": {
"code": "<string>",
"gmt_offset": 123,
"is_daylight_saving": true,
"name": "<string>",
"next_offset_change": "<string>"
},
"type": "<string>",
"version": 123,
"details": {
"band_map": "<string>",
"canonical_location_key": "<string>",
"canonical_postal_code": "<string>",
"climo": "<string>",
"key": "<string>",
"local_radar": "<string>",
"location_stem": "<string>",
"marine_station": "<string>",
"marine_station_gmt_offset": 123,
"media_region": "<string>",
"metar": "<string>",
"nx_metro": "<string>",
"nx_state": "<string>",
"population": 1,
"primary_warning_county_code": "<string>",
"primary_warning_zone_code": "<string>",
"satellite": "<string>",
"station_code": "<string>",
"station_gmt_offset": 123,
"synoptic": "<string>",
"video_code": "<string>",
"dma": {
"english_name": "<string>",
"id": "<string>"
},
"partner_id": "<string>",
"sources": [
{
"data_type": "<string>",
"source": "<string>",
"source_id": 123,
"partner_source_url": "<string>"
}
]
},
"parent_city": {
"english_name": "<string>",
"key": "<string>",
"localized_name": "<string>"
},
"supplemental_admin_areas": [
{
"english_name": "<string>",
"level": 123,
"localized_name": "<string>"
}
]
}
]
}请求规范
- 方法与路径: POST /apis/v1/accu-weather/list-top-cities
- 可用状态: enabled
- 请求 URL 模板:
https://api.aisa.one/apis/v1/accu-weather/list-top-cities
{
"operationId": "accu-weather.list-top-cities",
"method": "POST",
"path": "/apis/v1/accu-weather/list-top-cities",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [],
"security": [
{
"bearerAuth": []
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"count": {
"description": "Number of cities to return. Valid only for global rankings; defaults to 50.",
"enum": [
50,
100,
150
],
"examples": [
50,
100,
150
],
"type": "integer"
},
"details": {
"default": false,
"description": "Whether to include extended location details.",
"type": "boolean"
},
"language": {
"description": "Language code for global rankings; defaults to en-us and must be omitted for regional rankings.",
"examples": [
"en-us"
],
"minLength": 1,
"type": "string"
},
"language_id": {
"description": "Numeric AccuWeather language ID for regional rankings; defaults to 1 and must be omitted for global rankings.",
"examples": [
1
],
"minimum": 1,
"type": "integer"
},
"ranking_scope": {
"default": "global",
"description": "Rank cities globally or within one AccuWeather region.",
"enum": [
"global",
"region"
],
"type": "string"
},
"region_code": {
"description": "AccuWeather region code. Required only when ranking_scope is region.",
"examples": [
"NAM"
],
"minLength": 1,
"type": "string"
}
},
"type": "object"
}
}
},
"required": false
},
"x-aisa-status": "enabled",
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}
费用与请求规则
按实际用量收费。 默认请求预估费用:$0.0004 USD。 最终费用以实际用量为准。 账户适用价格可能不同;支持报价的接口可按实际请求获取报价。授权
请求体
application/json