Python SDK for the Cart e-commerce intelligence API
Project description
usecart
Python SDK for the Cart e-commerce intelligence API.
Zero dependencies. Python 3.9+.
Install
pip install usecart
Quick Start
from usecart import Cart
cart = Cart("cart_sk_...")
# Search stores
stores = cart.stores.search(keyword="fitness", platform="shopify", min_traffic=10000)
print(stores.data)
# [{"domain": "gymshark.com", "traffic": 4200000, ...}, ...]
# Get a single store
store = cart.stores.get("gymshark.com")
# Search products
products = cart.products.search(keyword="yoga mat", min_price=20)
# Get trending
trending = cart.trending()
# Check rate limits
print(cart.rate_limit)
# RateLimitInfo(remaining=99, limit=100)
Response Shape
Every method returns an ApiResponse with three attributes:
response = cart.stores.search(keyword="fitness")
response.data # list of dicts or single dict
response.meta # ApiResponseMeta(request_id, timestamp, page, total_pages, total_results)
response.usage # ApiResponseUsage(requests_today, limit)
Resources
| Resource | Methods |
|---|---|
cart.stores |
search(), get(), get_products(), get_ads(), get_traffic(), get_tech(), compare() |
cart.products |
search(), get(), trending() |
cart.ads |
search(), get() |
cart.suppliers |
search() |
cart.niches |
get() |
| top-level | cart.trending(), cart.account() |
Error Handling
from usecart import Cart, CartAuthError, CartRateLimitError, CartApiError
cart = Cart("cart_sk_...")
try:
stores = cart.stores.search(keyword="fitness")
except CartAuthError as e:
print(f"Auth failed: {e}")
except CartRateLimitError as e:
print(f"Rate limited. Retry after {e.retry_after}s")
except CartApiError as e:
print(f"API error {e.status}: {e.message}")
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
usecart-0.1.0.tar.gz
(7.0 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 usecart-0.1.0.tar.gz.
File metadata
- Download URL: usecart-0.1.0.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8a2b45045b02a99b9df5cafe66f860fbc3fd2d2991c698f264fef7cd9c962d8
|
|
| MD5 |
6b9dc47680612c8ac14a75ba09760f17
|
|
| BLAKE2b-256 |
1ce366812028220427a21ee86ddb17354a6ebf63709bf4f03cd6aee11c5f71d5
|
File details
Details for the file usecart-0.1.0-py3-none-any.whl.
File metadata
- Download URL: usecart-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf25b701b5ce332e2477768675d0cfafca45b7892ba2bb9597192ca7907a06a0
|
|
| MD5 |
a2cb5aeb7d6a888fd33c1a23c93092fc
|
|
| BLAKE2b-256 |
b5b9803e51c0d7293c5ff8501b66cf93524705abd0b8aa84655180248ad0413b
|