【题解】Using the GeoJSON API (Using Python to Access Web Data)

本文介绍了如何使用Python调用GeoJSON API获取地理位置信息。通过指定API端点并添加URL编码的参数,程序将获取并解析JSON数据,提取出首个`place_id`。示例中展示了如何处理无API密钥的情况,并提供了测试数据"South Federal University",其`place_id`为"ChIJ1Z9sheJZkFQRDePQqQebCdg"。最后,强调了必须使用指定的API端点,而不是常规的Google API,因为两者返回的`place_id`可能不同。
摘要由CSDN通过智能技术生成

吐槽:不难,修改一下老师的代码就出来了。最后一个题哦,这课我终于做完了= =

题目:Calling a JSON API

In this assignment you will write a Python program somewhat similar to http://www.py4e.com/code3/geojson.py. The program will prompt for a location, contact a web service and retrieve JSON for the web service and parse that data, and retrieve the first place_id from the JSON. A place ID is a textual identifier that uniquely identifies a place as within Google Maps.

API End Points

To complete this assignment, you should use this API endpoint that has a static subset of the Google Data:

http://py4e-data.dr-chuck.net/json?

This API uses the same parameter (address) as the Google API. This API also has no rate limit so you can test as often as

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值