Observed since 20 Oct, 21:30 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Python SDK for the Agent Attribution Protocol (AAP) — AI agent affiliate attribution
Python SDK for the Agent Attribution Protocol (AAP)
AAP enables AI agents to discover offers, make recommendations, and earn commission when those recommendations lead to purchases.
pip install agent-attribution-protocol
from agent_attribution_protocol import AAP
aap = AAP(api_key="your-api-key")
# Search for offers
result = aap.search(vertical="sim", max_price=10, contract_months=0)
print(f"Found {result.count} offers")
# Recommend an offer (records attribution)
rec = aap.recommend(
session_id=result.session_id,
offer_id=result.offers[0].id,
context="User asked for cheap SIM with no contract",
)
print(f"Recommendation recorded: {rec.recommendation_id}")
print(f"Fallback URL: {rec.fallback_url}")
# Initiate checkout
checkout = aap.checkout(
session_id=result.session_id,
recommendation_id=rec.recommendation_id,
)
print(f"Transaction: {checkout.transaction_id} ({checkout.status})")
AAP(api_key, base_url="https://api.affili.ai")Create a client. Can also be used as a context manager:
with AAP(api_key="your-key") as aap:
result = aap.search(vertical="sim")
aap.search(**kwargs) → SearchResult| Parameter | Type | Description |
|---|---|---|
vertical | str | sim, broadband, energy, flights, hotels, insurance |
provider | str | Filter by provider name |
max_price | float | Maximum price |
min_data_gb | int | Minimum data (SIM) |
contract_months | int | Contract length (0 = rolling) |
aap.recommend(session_id, offer_id, context=None) → RecommendationRecord a recommendation. This is the attribution event.
aap.checkout(session_id, recommendation_id, user_details=None) → CheckoutResultInitiate checkout.
aap.get_session(session_id) → SessionGet session details.
aap.verify_code(code) → dictVerify an AAP Code is authentic.
Apache 2.0
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.1.0 | 2 Apr 2026 | 1 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 21:30 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:f0d1e7f99b1193b7b89625acb2070f202e6fd0629dde465c0b3807a23238c71a