Загрузка...

Using a Geo Location API - Using Python to Access Web Data - ISC Python

Using a Geo Location API - Using Python to Access Web Data -
ISC Python: Programación y análisis de datos

PAGINA PARA HACER LA TAREA: colab.research.google.com
BLOG PARA EL CODIGO : https://ingicivil.blogspot.com/2024/11/using-geo-location-api.html
Asesoria: +51 998706806
Calling a JSON API

In this assignment you will write a Python program somewhat similar to http://www.py4e.com/code3/opengeo.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 plus_code from the JSON. An Open Location Code is a textual identifier that is another form of address based on the location of the address.
API End Points

To complete this assignment, you should use this API endpoint that has a static subset of the Open Street Map Data.

http://py4e-data.dr-chuck.net/opengeo?
This API also has no rate limit so you can test as often as you like. If you visit the URL with no parameters, you get "No address..." response.
To call the API, you need to provide the address that you are requesting as the q= parameter that is properly URL encoded using the urllib.parse.urlencode() function as shown in http://www.py4e.com/code3/opengeo.py
Test Data / Sample Execution

You can test to see if your program is working with a location of "South Federal University" which will have a plus_code of "6FV8QPRJ+VQ".

$ python solution.py
Enter location: South Federal University
Retrieving http://...
Retrieved 1290 characters
Plus code 6FV8QPRJ+VQ
Turn In

Please run your program to find the plus_code for this location:

Indian Institute of Technology Kharagpur India
Make sure to enter the name and case exactly as above and enter the plus_code and your Python code below. Hint: The first five characters of the plus_code are "7MJ98 ..."
Make sure to retreive the data from the URL specified above and not the normal Google API. Your program should work with the Google API - but the plus_code may not match for this assignment.

plus_code:

Python code:

Видео Using a Geo Location API - Using Python to Access Web Data - ISC Python канала INGENIERIA CIVIL
Страницу в закладки Мои закладки
Все заметки Новая заметка Страницу в заметки