Skip to main content

Python SDK

Use the Python SDK when building Python agents or backend services.

Run the local Python example

Try the SDK against the mock AAP server with AAP_API_KEY=aap_demo_key and fake checkout data.
Install
quickstart.py

Client

AAP(api_key, base_url="https://api.rako.sh")

Create a client. It can also be used as a context manager:

Methods

aap.search(**kwargs)

Search for offers.

aap.recommend(session_id, offer_id, context)

Record a recommendation. This is the attribution event.

aap.checkout(session_id, recommendation_id, user_details)

Initiate checkout for a recommended offer.

aap.get_session(session_id)

Get session details including recommendations and conversions.

aap.verify_code(code)

Verify an AAP Code is authentic.

Mock conversion learning

The runnable SDK example reaches a mock checkout URL. To understand why checkout-link creation is separate from conversion recording, see Mock Conversion Artifact.

PyPI

GitHub