Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

wbapi

Асинхронный клиент Wildberries Seller API

PyPI version Downloads Tests Coverage Checked with mypy Ruff Python

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")

Если у метода песочницы нет, запрос не уйдёт — клиент сообщит об этом.

Лицензия

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wbapi_async-1.0.0rc1.tar.gz (131.6 kB view details)

Uploaded Source

Built Distribution

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

wbapi_async-1.0.0rc1-py3-none-any.whl (173.5 kB view details)

Uploaded Python 3

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

Hashes for wbapi_async-1.0.0rc1.tar.gz
Algorithm Hash digest
SHA256 c6ca639a4f85fb78bf56ebfa78418d8ba580f42babba7020bd9bc3156f5ddaae
MD5 b7f2f490e85920f228676416b0d1a170
BLAKE2b-256 794107260732e3ed0abd7b66852a5689d0be99875b253c193aa4728a40e9b866

See more details on using hashes here.

Provenance

The following attestation bundles were made for wbapi_async-1.0.0rc1.tar.gz:

Publisher: pypi_release.yml on serdukow/wbapi-async

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for wbapi_async-1.0.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 fafe25a8bb8830ffccbe9b497e81f06ee0f19de55cab574b2b0325173bc5f9ee
MD5 cfeb52930defe066025a7765f63f9ac1
BLAKE2b-256 9e7f1488d309264ac269dcf491eedb9f75f59029daad265643ee8d3ff10c6114

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

1.1.1

2 files

1.1.0

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

This release

1.0.0rc1 This release

2 files

0.10.1

2 files

0.10.0

2 files

0.9.0

2 files

0.8.0

2 files

0.7.9

2 files

0.7.8

2 files

0.7.7

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page