Official Python SDK for the Actory Agent Commerce Protocol (ACP) API
Project description
Actory Python SDK
Official Python client for the Actory Agent Commerce Protocol (ACP) API.
Installation
pip install actory
Quick Start
from actory import Actory
# Initialize with your API key
client = Actory(api_key="act_sk_your_key_here")
# Search for products
results = client.search("red shoes", max_price=100, in_stock=True)
print(f"Found {results.total} products")
for product in results.products:
print(f" {product.title}: ${product.price}")
Features
Search Products
# Basic search
results = client.search("shoes")
# With filters
results = client.search(
"shoes",
in_stock=True,
min_price=20,
max_price=100,
vendor="Nike",
category="footwear",
limit=50,
page=1
)
Natural Language Search
# Parse natural language queries
results = client.nl_search("red shoes under $50 in stock")
# Automatically extracts: color=red, maxPrice=50, inStock=true
Get Product Details
product = client.get_product("product_id_here")
print(product.title, product.price, product.vendor)
List Merchants
merchants = client.list_merchants()
for m in merchants:
print(f"{m.name}: {m.product_count} products")
List Categories & Vendors
categories = client.list_categories()
vendors = client.list_vendors()
Error Handling
from actory import Actory, AuthenticationError, RateLimitError, ActoryError
try:
client = Actory(api_key="invalid_key")
results = client.search("test")
except AuthenticationError:
print("Invalid API key")
except RateLimitError:
print("Too many requests, slow down")
except ActoryError as e:
print(f"API error: {e}")
Configuration
# Custom base URL (for local development)
client = Actory(
api_key="act_sk_...",
base_url="http://localhost:3000/api"
)
Get an API Key
- Visit actory.ai/keys
- Create a new API key
- Copy and use in your application
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
actory-0.1.1.tar.gz
(4.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file actory-0.1.1.tar.gz.
File metadata
- Download URL: actory-0.1.1.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
49a40d37403964a7e072c3aba9e1d1dd214b72a28c3f7543fcaa4fb36644d6c6
|
|
| MD5 |
bfbc58a65c89b0a819563b23a6ecd009
|
|
| BLAKE2b-256 |
fbd34e81fd18bf85bf87aba002a5dc2b5e060a70ac05edca8c353ad14ca516b9
|
File details
Details for the file actory-0.1.1-py3-none-any.whl.
File metadata
- Download URL: actory-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6d1a129367f2371b729b8bf138e26d600e2be58a04a6920f7978c82f875e0ab
|
|
| MD5 |
97a406c3d47c41d570641b0b84b66292
|
|
| BLAKE2b-256 |
11434190f406a4cf3c3ff87c908bf47c5afe49db5315d933a1b8f73a9101bedc
|