requests 或 JavaScript 的 fetch 的函式庫)或 使用 API 工具 像 Apidog。YOUR_API_KEY 替換為您註冊後獲得的實際 key):GET http://api.weatherapi.com/v1/current.json?key=3432a351afd04b30bef75833252711&q=London&aqi=noGET — 檢索資料http://api.weatherapi.com/v1/current.json,參數 key = 您的 API key,q = “London”,aqi=no 跳過空氣品質資料GET。http://api.weatherapi.com/v1/current.json?key=3432a351afd04b30bef75833252711&q=London&aqi=no200,加上回應時間和 JSON Body。daily_units、daily.time、daily.temperature_2m_max 等欄位。q 更改為不同的城市(例如 q=New York)並重新發送請求以查看回應如何變化。HTTP/1.1 200 OK
Headers: (ignored for simplicity){
"location": {
"name": "London",
"region": "City of London, Greater London",
"country": "United Kingdom",
"lat": 51.5171,
"lon": -0.1062,
"tz_id": "Europe/London",
"localtime_epoch": 1764232379,
"localtime": "2025-11-27 08:32"
},
"current": {
"last_updated_epoch": 1764232200,
"last_updated": "2025-11-27 08:30",
"temp_c": 11.2,
"temp_f": 52.2,
"is_day": 1,
"condition": {
"text": "Overcast",
"icon": "//cdn.weatherapi.com/weather/64x64/day/122.png",
"code": 1009
},
"wind_mph": 10.1,
"wind_kph": 16.2,
"wind_degree": 225,
"wind_dir": "SW",
"pressure_mb": 1015.0,
"pressure_in": 29.97,
"precip_mm": 0.0,
"precip_in": 0.0,
"humidity": 94,
"cloud": 100,
"feelslike_c": 9.3,
"feelslike_f": 48.7,
"windchill_c": 8.0,
"windchill_f": 46.3,
"heatindex_c": 10.2,
"heatindex_f": 50.3,
"dewpoint_c": 9.0,
"dewpoint_f": 48.2,
"vis_km": 10.0,
"vis_miles": 6.0,
"uv": 0.0,
"gust_mph": 17.1,
"gust_kph": 27.5,
"short_rad": 0.68,
"diff_rad": 0.31,
"dni": 11.17,
"gti": 0.0
}
}