Skip to main content

SDK (TypeScript / Python)

TypeScript SDK 0.7.0 is on npm. Install with npm install @wellbyte/sdk (current release @wellbyte/sdk@0.7.0, npm). The Python client is on PyPI: pip install wellbyte (current release wellbyte==0.7.0).

The official Python client covers /v1 sync calls, Jobs, and Catalog. WellbyteClient sends Authorization: Bearer <api_key> on every request. The default User-Agent is wellbyte-sdk-py/0.7.0. HTTP 202 auto-polls to a terminal status.

Install

bash
pip install wellbyte==0.7.0
npm install @wellbyte/sdk@0.7.0

Python

python
from wellbyte import WellbyteClient

with WellbyteClient(api_key="dg_live_xxx", base_url="https://api.wellbyte.net") as client:
    # Authorization: Bearer dg_live_xxx
    # User-Agent: wellbyte-sdk-py/0.7.0
    note = client.call("/v1/xiaohongshu/note/detail", {"note_id": "demo_note_ok"})
    print(note)

    job = client.create_job({
        "endpoint": "xiaohongshu.note.detail",
        "params": [{"note_id": "demo_note_ok"}],
    })
    print(job)

Those calls send:

http
Authorization: Bearer dg_live_xxx
User-Agent: wellbyte-sdk-py/0.7.0
Accept: application/json

202 behavior

An oversized sync request can return 202 + job_id. The SDK polls GET /v1/jobs/{id} until a terminal status: succeeded, partial, failed, canceled, expired, or rejected. Set auto_poll=False to keep the raw 202 envelope.

See Auth and Jobs.

Without the SDK

Use WellbyteClient after pip install. For a one-off HTTP call:

bash
curl -s 'https://api.wellbyte.net/v1/xiaohongshu/note/detail?note_id=demo_note_ok' \
  -H "Authorization: Bearer dg_live_YOUR_KEY" \
  -H "Accept: application/json"

TypeScript

typescript
import { WellbyteClient } from "@wellbyte/sdk";

const client = new WellbyteClient({
  apiKey: "dg_live_xxx",
  baseUrl: "https://api.wellbyte.net",
});

// Authorization: Bearer dg_live_xxx
// User-Agent: wellbyte-sdk-ts/0.7.0
const note = await client.call("/v1/xiaohongshu/note/detail", {
  note_id: "demo_note_ok",
});
console.log(note);

const job = await client.jobs.create({
  endpoint: "xiaohongshu.note.detail",
  params: [{ note_id: "demo_note_ok" }],
});
console.log(job);

Those calls send:

http
Authorization: Bearer dg_live_xxx
User-Agent: wellbyte-sdk-ts/0.7.0
Accept: application/json

Search

Search endpoints and docs