API查询搜索位置
https:// host/search?q = new%20york&format = json/[your-api-key]
API响应
{“ searchResults”:{“ query”:“纽约”,“ loc”:[{“ id”:“ 105128581”“名称”:“纽约市”,“纽约”,“乡村”:“美国”,“ TZ”:“美国\/new_york”,“ lon”:“ - 74.005973816”,“ lat”:“ 40.714267731”},{“ id”:“ 105128616”,“ 105128616”,“名称”:“ new York Mills”:“ New York Mills”,“乡村”:“”:“”:“”:“”:“”美国”,“ tz”:“美国\/new_york”,“ lon”:“ - 75.291275024”,“ lat”:“ 43.105346680”},{“ id”:“ 105039192”“,“乡村”:“美国”,“ tz”:“美国\/north_dakota \/中心”,“ lon”:“ - 95.3761444409”,“ lat”:“ 46.518016815”}}}}}}}}
从结果列表中选择位置,然后使用其“ ID”请求天气数据以进行位置:
http:// host/data?l = 105128581&ftimes = 48/24H&格式= json/[your_api_key]&tempunit = c&windunit = ms&tz =