Predicta
Search
Docs
Ctrl KPredicta SearchGet an API key
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 predictasearch

It needs Python 3.11 or later.

Methods and routes

MethodRouteReturns
search_by_email, search_by_phone, search_by_name, search_by_usernamePOST /api/searchThe JSON body
get_supported_networks()GET /api/networksThe JSON body
start_search(query, query_type, networks=None)POST /api/v2/searchThe 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.