This release is a pre-release and may not be stable for production use.
308 методов и 687 моделей, сгенерированных из официальных спецификаций Wildberries. Автодополнение в редакторе, повторы при сбоях, лимиты запросов и постраничный обход из коробки.
Установка
Требуется Python 3.10+.
pip install wbapi-async
Быстрый старт
import asyncio
import os
from wbapi import WBApi
async def main() -> None:
async with WBApi(token=os.environ["WB_TOKEN"]) as api:
orders = await api.orders_fbs.orders_new()
for order in orders.orders:
print(order.id, order.nm_id, order.sale_price)
asyncio.run(main())
Разделы
await api.general.seller_info()
await api.items.content_v2_cards_limits()
await api.orders_fbs.orders_new()
await api.promotion.adv_v1_promotion_count()
await api.finances.account_balance()
| Раздел | Что внутри |
|---|---|
general |
Общее: подключение, продавец, пользователи |
items |
Работа с товарами: карточки, категории, медиа |
orders_fbs |
Заказы FBS: задания, поставки, пропуска |
orders_dbs |
Заказы DBS |
orders_dbw |
Заказы DBW |
orders_fbw |
Поставки FBW |
in_store_pickup |
Самовывоз |
promotion |
Маркетинг и продвижение |
communications |
Отзывы, вопросы, чат с покупателями |
analytics |
Аналитика и данные |
reports |
Отчёты |
finances |
Документы и бухгалтерия |
rates |
Тарифы |
wbd |
Wildberries Цифровой |
Ответы
response = await api.orders_fbs.orders_new()
order = response.orders[0]
order.nm_id
order.sale_price
order.created_at
order.to_dict()
order.to_dict(by_alias=True)
order.to_json()
Постраничный обход
# одна страница
page = await api.orders_fbs.orders(limit=1000, next_=0)
# все страницы списком
rows = await api.orders_fbs.orders(limit=1000, next_=0, auto_paginate=True)
# по одной записи — память не растёт с размером выборки
async for order in api.orders_fbs.iter_orders(limit=1000, next_=0):
await save(order)
Повторы и лимиты
Запросы к 429, 5xx и сетевым сбоям повторяются автоматически — с
экспоненциальной задержкой, джиттером и учётом заголовка X-Ratelimit-Retry.
api = WBApi(
token=...,
timeout=60, # или httpx.Timeout(connect=5, read=60)
max_retries=3,
retry_backoff=0.5,
max_retry_wait=60,
user_agent="myapp/1.0",
)
Песочница
Нужен токен с опцией «Тестовый контур» — данные там случайные.
async with WBApi(token=..., sandbox=True) as api:
supply = await api.orders_fbs.supplies_create(name="test")
Если у метода песочницы нет, запрос не уйдёт — клиент сообщит об этом.
Лицензия
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 wbapi_async-1.0.0rc1.tar.gz.
File metadata
- Download URL: wbapi_async-1.0.0rc1.tar.gz
- Upload date:
- Size: 131.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6ca639a4f85fb78bf56ebfa78418d8ba580f42babba7020bd9bc3156f5ddaae
|
|
| MD5 |
b7f2f490e85920f228676416b0d1a170
|
|
| BLAKE2b-256 |
794107260732e3ed0abd7b66852a5689d0be99875b253c193aa4728a40e9b866
|
Provenance
The following attestation bundles were made for wbapi_async-1.0.0rc1.tar.gz:
Publisher:
pypi_release.yml on serdukow/wbapi-async
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wbapi_async-1.0.0rc1.tar.gz -
Subject digest:
c6ca639a4f85fb78bf56ebfa78418d8ba580f42babba7020bd9bc3156f5ddaae - Sigstore transparency entry: 2534393023
- Sigstore integration time:
-
Permalink:
serdukow/wbapi-async@5f4b095e6e949736976f8aadd78db53367092f81 -
Branch / Tag:
refs/tags/v1.0.0rc1 - Owner: https://github.com/serdukow
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi_release.yml@5f4b095e6e949736976f8aadd78db53367092f81 -
Trigger Event:
release
-
Statement type:
File details
Details for the file wbapi_async-1.0.0rc1-py3-none-any.whl.
File metadata
- Download URL: wbapi_async-1.0.0rc1-py3-none-any.whl
- Upload date:
- Size: 173.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fafe25a8bb8830ffccbe9b497e81f06ee0f19de55cab574b2b0325173bc5f9ee
|
|
| MD5 |
cfeb52930defe066025a7765f63f9ac1
|
|
| BLAKE2b-256 |
9e7f1488d309264ac269dcf491eedb9f75f59029daad265643ee8d3ff10c6114
|
Provenance
The following attestation bundles were made for wbapi_async-1.0.0rc1-py3-none-any.whl:
Publisher:
pypi_release.yml on serdukow/wbapi-async
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wbapi_async-1.0.0rc1-py3-none-any.whl -
Subject digest:
fafe25a8bb8830ffccbe9b497e81f06ee0f19de55cab574b2b0325173bc5f9ee - Sigstore transparency entry: 2534393053
- Sigstore integration time:
-
Permalink:
serdukow/wbapi-async@5f4b095e6e949736976f8aadd78db53367092f81 -
Branch / Tag:
refs/tags/v1.0.0rc1 - Owner: https://github.com/serdukow
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi_release.yml@5f4b095e6e949736976f8aadd78db53367092f81 -
Trigger Event:
release
-
Statement type: