final String FORECAST_BASE_URL =
"http://api.openweathermap.org/data/2.5/forecast/daily?";
final String QUERY_PARAM = "q";
你好。我正在制作一款天气预报应用程序。但是当我使用“http://openweathermap.org”的API时,我遇到了困难,如何获取城市代码或ID“q”?我试图找到城市ID,但是我找不到。
按城市ID调用的示例代码:
api.openweathermap.org/data/2.5/forecast/daily?id=524901
我听说“q”也用于“id”。我的意思是
api.openweathermap.org/data/2.5/forecast/daily?q=524901
也有可能。我希望能够像这样做。
那么,如何找到城市ID呢? 有人知道吗?