API Reference
Base URL
https://app.sellerlegend.com/apiAll API requests must be made over HTTPS.
Authentication
All requests require a valid OAuth 2.0 Bearer token. Include it in the Authorization header:
Authorization: Bearer {ACCESS_TOKEN}See Getting Started and OAuth Token Management for details on obtaining and refreshing tokens.
Request Headers
| Header | Value | Required |
|---|---|---|
Authorization | Bearer {ACCESS_TOKEN} | Yes |
Content-Type | application/json | Yes (POST requests) |
Accept | application/json | Recommended |
Account Selection
Most endpoints require you to specify which Amazon account to query. Include one of the following as a query parameter:
| Method | Parameter(s) | Example |
|---|---|---|
| By account title | account_title | ?account_title=My Store US |
| By seller + marketplace | seller_id & marketplace_id | ?seller_id=A1234567890&marketplace_id=ATVPDKIKX0DER |
| By group | group_title | ?group_title=North America |
Pagination
Paginated responses include the following fields:
| Field | Description |
|---|---|
current_page | The current page number |
total | Total number of records |
per_page | Number of records per page |
last_page | The last available page number |
Use the page query parameter to navigate between pages.
Rate Limits
API requests are rate-limited to 180 requests per minute. The rate limit window resets every minute.
Response headers:
| Header | Description |
|---|---|
X-RateLimit-Limit | Maximum requests allowed (180) |
X-RateLimit-Remaining | Requests remaining in current window |
Retry-After | Seconds to wait before retrying (only on 429) |
When rate limited, implement exponential backoff before retrying.
Error Codes
| Code | Meaning |
|---|---|
401 | Unauthorized — invalid or expired token |
403 | Forbidden — insufficient permissions |
404 | Resource not found |
422 | Validation error — check request parameters |
429 | Rate limit exceeded — slow down requests |
500 | Internal server error |
Python SDK
The SellerLegend Python SDK provides a convenient wrapper around the API.
Installation:
pip install sellerlegend-apiClient Initialization:
from sellerlegend_api import SellerLegendClient
# Initialize with an existing access token
client = SellerLegendClient(
access_token="YOUR_ACCESS_TOKEN"
)
# Or initialize with OAuth credentials
client = SellerLegendClient(
client_id="your-client-id",
client_secret="your-client-secret",
redirect_uri="https://yourapp.com/callback"
)Token Refresh Pattern:
from sellerlegend_api import SellerLegendClient
class TokenManager:
def refresh_and_get_client(self, refresh_token):
client = SellerLegendClient(
client_id="YOUR_CLIENT_ID",
client_secret="YOUR_CLIENT_SECRET",
refresh_token=refresh_token
)
new_tokens = client.refresh_token()
# Store the new tokens — the old refresh token is now invalid
self.update_tokens_in_database(
access_token=new_tokens['access_token'],
refresh_token=new_tokens['refresh_token'],
expires_in=new_tokens['expires_in']
)
return SellerLegendClient(
access_token=new_tokens['access_token']
)See each endpoint page for usage examples in Python, PHP, JavaScript, and cURL.
Downloadable Resources
Available Endpoints
| Section | Endpoints |
|---|---|
| User | Current user info, account listing |
| Sales | Orders, statistics, daily sales, transactions |
| Inventory | Inventory listing with velocity metrics |
| COGS | Cost periods — read, create, delete |
| Reports | Request, check status, and download reports |
| Warehouse | Warehouse inventory and inbound shipments |
| Supply Chain | Restock suggestions |
| Notifications | Inventory, price, and restock alerts |
| Connections | SP-API and PPC connection status |
| Service Status | API health check |
| PPC | Sponsored Products, Brands, and Display advertising data |
| Schema | Discover filterable columns for any datatable |