Python SDK
The official PredictHQ Python Client provides a consistent, pythonic interface to our API.
Example
Installation
pip install predicthqSetup the SDK
from predicthq import Client
# Initialises PredictHQ client library using your access token.
# Note: You can find/create your access token at https://control.predicthq.com/clients
phq = Client(access_token="$ACCESS_TOKEN")Search Events
for event in phq.events.search(q="Foo Fighters", rank_level=[4, 5], country='US'):
print(event.rank, event.category, event.title, event.start.strftime('%Y-%m-%d'))Further Examples
Found an Issue?
Last updated
Was this helpful?