The API Wrapper - p123api

Describes the p123api package with objects and functions that facilitate using the P123 API

Marco Salerno
Written by Marco SalernoLast update 11 days ago

To facilitate using the our Rest API we created a python package that wraps the API endpoints. The package is called p123api and it makes it very easy to start using the API. It handles several things like retries, authentication and low level http request. The wrapper is an open source project and is hosted at pypi.org.

Functions

Each API endpoint has been wrapped with a function. They are listed below grouped the same way as the API reference. The parameters for the functions should be identical to the API specification. Lastly, for optional parameter the default value when not specified is the first value in the list (if any).

AI Factor

Data Retrieval

Universe

Rank

Screen

Strategy

Data Series

Stock Factors

Examples

To use p123api you can start your code like this:

# Install p123api if missing
!pip install --upgrade p123api

import p123api

try:
    client = p123api.Client(api_id='YOUR_API_ID', api_key='YOUR_API_KEY_XXXX')  
    
    # call package function(s)
    res1 = client.p123api_function1()

    ... etc ...

except p123api.ClientException as e:
    print(e)

Did this answer your question?