Skip to content

Instantly share code, notes, and snippets.

@gisfromscratch
Created January 14, 2022 23:32
Show Gist options
  • Save gisfromscratch/1bf7022e561df898ba5a4e2144a89c4f to your computer and use it in GitHub Desktop.
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.
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