【发布时间】:2019-10-24 03:50:34
【问题描述】:
我想调用 curl 函数 python 脚本来调用 API。这是怎么做到的。
我从终端执行了它的工作正常。
curl --header "Authorization: Api-Key ABCD1234" https://api.lat.com/western/v1/forecasts?locodes=PLWRE,DEHLI
{"results":[{"place":{"type":"locode","value":"PLWRO"},"measures":[{"ts":1571896800000,"t2m":10.72,"t_min":10.53,"t_max":11.99,"wspd":8,"dir":"SE","wgust":12,"rh2m":87,"prsmsl":1012,"skcover":"clear","precip":0.0,"snowd":0,"thunderstorm":"N","fog":"H"}]},{"place":{"type":"locode","value":"DEHAM"},"measures":[{"ts":1571896800000,"t2m":10.79,"t_min":10.3,"t_max":10.9,"wspd":13,"dir":"ESE","wgust":31,"rh2m":97,"prsmsl":1008,"skcover":"partly_cloudy","precip":0.0,"snowd":0,"thunderstorm":"N","fog":"H"}]}]}sh-4.2$
如何做到这一点?
【问题讨论】:
标签: python-3.x pandas curl https