Created
January 14, 2022 23:32
-
-
Save gisfromscratch/1bf7022e561df898ba5a4e2144a89c4f to your computer and use it in GitHub Desktop.
Aggregates the broadcasted news related to protests/demonstrations using a spatial grid and returns the features as hexagonal bins.
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/aggregate' | |
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