Catalog PyPI
PACKAGE EXPLORERView in registry

agent-attribution-protocol

PyPI

Python SDK for the Agent Attribution Protocol (AAP) — AI agent affiliate attribution

aapaffiliateagentaiattributioncommercemcpprotocol
Versions collected1
Direct dependencies1From release 0.1.0
Last observed20 Oct, 21:30 UTC

README

Version 0.1.0 documentation

agent-attribution-protocol

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.

Install

pip install agent-attribution-protocol

Quick Start

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})")

API

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

ParameterTypeDescription
verticalstrsim, broadband, energy, flights, hotels, insurance
providerstrFilter by provider name
max_pricefloatMaximum price
min_data_gbintMinimum data (SIM)
contract_monthsintContract length (0 = rolling)

aap.recommend(session_id, offer_id, context=None) → Recommendation

Record a recommendation. This is the attribution event.

aap.checkout(session_id, recommendation_id, user_details=None) → CheckoutResult

Initiate checkout.

aap.get_session(session_id) → Session

Get session details.

aap.verify_code(code) → dict

Verify an AAP Code is authentic.

Licence

Apache 2.0

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.1.02 Apr 20261

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
affili-ai/aap-python

Shared repository data · GitHub

License detected in repository
Not collected

Repository

PENDING
affili-ai/aap-spec

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 21:30 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:f0d1e7f99b1193b7b89625acb2070f202e6fd0629dde465c0b3807a23238c71a