Get started
Python library
predictasearch is our Python package: one method per route, sending your key and returning what the API returns.
Install
Terminal
pip install predictasearchIt needs Python 3.11 or later.
Methods and routes
| Method | Route | Returns |
|---|---|---|
search_by_email, search_by_phone, search_by_name, search_by_username | POST /api/search | The JSON body |
get_supported_networks() | GET /api/networks | The JSON body |
start_search(query, query_type, networks=None) | POST /api/v2/search | The requests.Response |
stream_search(search_id, last_event_id=None) | GET /api/v2/search/{search_id} | The requests.Response, its stream left unread |
The package adds no logic of its own: the status codes, the events and the errors are the ones described in this reference.
Usage
The package page shows how to use each method, read a v2 stream, resume it after a dropped connection and handle the errors: pypi.org/project/predictasearch. The source is on GitHub.