Skip to content

Python ​

Package: valeryverkhoturov-wb-api-client on PyPI.

  • Python: 3.9+
  • HTTP: urllib3
  • Models: pydantic v2
  • Secret wrapper: pydantic.SecretStr

Install ​

bash
pip install valeryverkhoturov-wb-api-client

For projects on Poetry / uv / PDM, add the dependency the usual way:

toml
[project]
dependencies = [
  "valeryverkhoturov-wb-api-client",
]
bash
uv add valeryverkhoturov-wb-api-client
bash
poetry add valeryverkhoturov-wb-api-client

Import shape ​

The distribution installs one top-level package wb_api_client with 13 sub-modules — one per WB API category. Each sub-module is a self-contained SDK with its own Configuration, ApiClient, and exactly one API class named after the module (GeneralApi, ItemsApi, OrdersFbsApi, and so on).

python
from wb_api_client.<slug> import Configuration, ApiClient
from wb_api_client.<slug>.api import <Module>Api

Sub-modules ​

SlugCategory
generalОбщее — ping, seller info, user management
itemsРабота с товарами (Content)
orders_fbsЗаказы FBS
orders_dbwЗаказы DBW
dbsDBS
in_store_pickupСамовывоз
orders_fbwПоставки FBW
promotionМаркетинг и продвижение
communicationsОбщение с покупателями
ratesТарифы
analyticsАналитика и данные
reportsОтчёты
financesДокументы и бухгалтерия

Each sub-module exposes a single API class named after the module: general → GeneralApi, items → ItemsApi, orders_fbs → OrdersFbsApi, and so on. The full list is in the per-release README: clients/python/README.md.

Auth ​

python
from wb_api_client.items import Configuration, ApiClient
from wb_api_client.items.api import ItemsApi

cfg = Configuration(access_token="<your WB JWT>")   # wrapped in SecretStr
client = ApiClient(cfg)
api = ItemsApi(client)

Passing a bare string is fine — it's auto-wrapped. If you want the raw token back for logging / diagnostics:

python
cfg.access_token                     # SecretStr(**********)
cfg.access_token.get_secret_value()  # "<your WB JWT>"

Async / sync ​

The generated client is synchronous (urllib3). If you need async, run calls in a thread pool:

python
import asyncio
result = await asyncio.to_thread(api.get_v1_seller_info)

A native-async variant is not on the roadmap — openapi-generator's async-python template lags the sync one.

Type hints ​

Every model is a pydantic v2 model. Editors and type-checkers see full types:

python
from wb_api_client.items.models import Product   # dataclass-like pydantic model
p: Product = Product.model_validate(some_dict)

Testing against the client ​

The Configuration object accepts a host override so you can point at a mock server:

python
cfg = Configuration(
    access_token="test-token",
    host="http://localhost:8080",
)

See also ​

wb-api-client mascot