如何从 API 获取特定数据

How to GET specific data from an API

你好,我想使用 python 从 https://www.metaweather.com/api/ 获取伦敦 3 天的预报,但是当我使用此 url 时: 'https://www.metaweather.com/api/location/44418/2013/4/27/' 我得到 jason 的预报这一天的不同时间。我想要一份今天的预报。

你能帮帮我吗?

import json
import requests
r=requests.get('https://www.metaweather.com/api/location/44418/2013/4/27/').text
weather=json.loads(r)