Catalog PyPI
Back to packageRELEASE DETAILS

0.1.0

PyPI

agent-attribution-protocol

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

aapaffiliateagentaiattributioncommercemcpprotocol
Published2 Apr 2026
Direct dependencies1
Transitive dependenciesNot calculated

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.

Declared dependencies 1

Native requirements
1 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
httpx
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
httpx>=0.25runtime

Distribution files

2 collected
agent_attribution_protocol-0.1.0-py3-none-any.whl

bdist_wheel · 4.8 KB · Python py3

Source file
agent_attribution_protocol-0.1.0.tar.gz

sdist · 3.4 KB · Python source

Source file

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_version:d9b3f6d61e4f443af019cd97032b1f736fef04fa44b8e38598c9e1542df9bd2a

Other collected versions

View all collected versions →