Skip to main content

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

  1. Visit actory.ai/keys
  2. Create a new API key
  3. 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.4.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

actory-0.1.4-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file actory-0.1.4.tar.gz.

File metadata

  • Download URL: actory-0.1.4.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for actory-0.1.4.tar.gz
Algorithm Hash digest
SHA256 da78bb17b633abc2ed1a49327f918e152eaa1a2e0249e7610a1cafb14a67bbd3
MD5 1f3f2b8384355f3f36581ee04a3bfa42
BLAKE2b-256 79844b68352a7fbaef5ccaec0324f51c9e6a7a08af7b3586e84b7a70c2d2b723

See more details on using hashes here.

File details

Details for the file actory-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: actory-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for actory-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 fc74f664e5d3fe1c4fbc025a38ac07e27e4de254ab24cd3b271120719bb192b1
MD5 9b74d1938ded1637113ff1e51182e455
BLAKE2b-256 0424e25aaf048d8ff11b41d7af9dbfd0896a7bc318ab6b26e0ca14076f9d9eb4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page