Created
January 14, 2022 23:44
-
-
Save gisfromscratch/dc47b6653dadb3d3cc38b3dd8e40a399 to your computer and use it in GitHub Desktop.
Returns the hotspot locations related to protests/demonstrations.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
url = 'https://geoprotests.p.rapidapi.com/hotspots' | |
querystring = { | |
'date': '2021-12-31', | |
'format': 'geojson' | |
} | |
# Authenticate: https://rapidapi.com/auth | |
api_key = '<SIGN-UP-FOR-KEY>' | |
headers = { | |
'x-rapidapi-host': 'geoprotests.p.rapidapi.com', | |
'x-rapidapi-key': api_key | |
} | |
geojson_response = requests.request('GET', url, headers=headers, params=querystring) | |
features = geojson_response.json() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment