Metadata-Version: 2.4
Name: wok-api
Version: 1.2.0
Summary: Dependency-free synchronous client for the WOK Steam API
Author: WOK API
License-Expression: LicenseRef-Proprietary
Project-URL: Homepage, https://woksteamapi.com
Project-URL: Documentation, https://woksteamapi.com/docs
Keywords: wok-api,steam,steam-api,steam-inventory-api,steamwebapi,cs2,inventory,faceit
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# WOK API client for Python

Dependency-free synchronous client for the
[WOK Steam API](https://woksteamapi.com/docs). It is distributed as the single
`wok_api` module and uses only the Python standard library at runtime.

## Requirements

- Python 3.10 or newer
- A WOK API key

For development, the Free Developer plan provides 1,000 requests per calendar
month, a 100-request daily guard and 30 requests per minute. Create a key at
<https://woksteamapi.com/pricing>.

Keep the API key in a server-side environment variable or secret store. Do not
commit it to source control or send it to browser clients.

## Install

```sh
python -m pip install wok-api
```

## Usage

```python
import os

from wok_api import WokApi, WokApiError

client = WokApi(os.environ["WOK_API_KEY"])
steam_id = os.environ["STEAM_ID"]

try:
    inventory = client.inventory(
        steam_id,
        game="cs2",
        top=25,
    )
    print(inventory)
except WokApiError as error:
    print(error.status, error, error.retry_after)
```

The client also exposes methods for profiles, friends, catalog prices, price
history, CS2 inspection, crawl jobs, FACEIT data, and service health. See the
[API reference](https://woksteamapi.com/docs) for request and response shapes.

Render a modern CS2 inspect certificate as PNG bytes:

```python
png = client.cs2_screenshot(
    certificate=os.environ["CS2_INSPECT_CERTIFICATE"],
    theme="wok",
    item_name="AK-47 | Redline (Field-Tested)",
)
with open("wok-cs2-inspect.png", "wb") as output:
    output.write(png)
```

`WokApiError` provides `status`, `payload`, `retry_after`, `rate_limit`,
`rate_remaining`, and `rate_reset`. Wait at least `retry_after` seconds after
HTTP 429. Network failures use status `0`.

The default timeout is 35 seconds so the 25-second synchronous inventory batch
can finish. Do not configure `/v1/inventories` with a timeout below 30 seconds.

For testing or a compatible deployment, pass `base_url`, `timeout`, or a custom
`transport` to the constructor.

## Build the package

```sh
python -m build
```

The command creates both an sdist and a wheel under `dist/`.
