Wildberries Python SDK
Professional, contract-oriented Python client for Wildberries API.
Features
- Async/Sync support - Works with both async and synchronous code using httpx
- Type-safe - Full Pydantic V2 models with validation
- Rate limiting - Intelligent token-based rate limiting with category isolation
- Error handling - Typed exception hierarchy for all API errors
- Registry-based - YAML configuration for easy endpoint extension
- Sandbox/Production - Support for both WB environments
- Pagination - Built-in async/sync page iterators
Installation
pip install wildberries-python-sdk
Or with development dependencies:
pip install wildberries-python-sdk[dev]
Quick Start
Async Client
import asyncio
from wildberries_python_sdk import BaseClient, Registry, RateLimiter, GeneralService
async def main():
registry = Registry("config/endpoints")
ratelimiter = RateLimiter()
client = BaseClient(
token="your-api-token",
registry=registry,
ratelimiter=ratelimiter
)
service = GeneralService(client)
info = await service.get_seller_info()
print(f"Seller: {info.name}")
await client.close()
asyncio.run(main())
Sync Client
from wildberries_python_sdk import SyncClient, Registry, RateLimiter, GeneralService
with SyncClient("token", registry, ratelimiter) as client:
service = GeneralService(client)
info = service.get_seller_info()
print(info.name)
Services
| Service | Description |
|---|---|
GeneralService |
Connection check, news, seller info, user management |
ProductsService |
Categories, product cards, tags |
WarehouseService |
Seller warehouses management |
InventoryService |
Stock management |
PricesService |
Prices and discounts |
MediaService |
Media files upload |
Products API Example
from wildberries_python_sdk import ProductsService
service = ProductsService(client)
# Get categories
categories = await service.get_parent_categories()
for cat in categories.data:
print(f"{cat.id}: {cat.name}")
# Get product cards
cards = await service.get_cards_list(
settings={"cursor": {"limit": 100}}
)
Error Handling
from wildberries_python_sdk import WBAPIError, TooManyRequestsError
try:
result = await service.get_data()
except TooManyRequestsError as e:
print(f"Rate limited! {e.detail}")
except WBAPIError as e:
print(f"API Error {e.status}: {e.detail}")
Configuration
from wildberries_python_sdk import Config, DomainType, set_default_locale
# Set global configuration
set_default_locale("en")
# Or use Config class
config = Config(locale="en", domain=DomainType.SANDBOX)
Development
# Clone and install
git clone https://github.com/wildberries/wildberries-python-sdk
cd wildberries-python-sdk
pip install -e ".[dev]"
# Run tests
pytest tests/
# Type checking
mypy src/
# Linting
ruff check src/
License
MIT License - see LICENSE file for details.
Metadata
Release files for wildberries-python-sdk 0.1.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| wildberries_python_sdk-0.1.11.tar.gz | 26.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| wildberries_python_sdk-0.1.11-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 58.1 kB
Release files / wildberries_python_sdk-0.1.11.tar.gz
| Download URL | wildberries_python_sdk-0.1.11.tar.gz |
|---|---|
| Size | 26.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c5f544db41762db62ea17b7cab87b04aa0e12671891ba07aa93f491b41ad79a7
|
|
BLAKE2b-256 checksum How to use checksums |
38314a168476a8a84bb882c8d6283966f37f2e49166f558ba93a1a92bb065290
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / wildberries_python_sdk-0.1.11-py3-none-any.whl
| Download URL | wildberries_python_sdk-0.1.11-py3-none-any.whl |
|---|---|
| Size | 31.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e91ff30f401360a0c9a70b7990083e39b3bc3085a48773a0347aa05ad04d598f
|
|
BLAKE2b-256 checksum How to use checksums |
5e23128d70fb269a1313f0fb7b023ea11a4ca8e4355d577876069784e484991e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|