SDKs

Official Python and TypeScript clients for the ListBee API.

ListBee ships first-party SDKs for Python and TypeScript. Both are thin wrappers over the REST API with typed responses, automatic retries, and cursor-based pagination helpers.

Python

Install

$pip install listbee

Requires Python 3.9+.

Auth

1from listbee import ListBee
2
3client = ListBee(api_key="lb_...")

Pass api_key explicitly, or set the LISTBEE_API_KEY environment variable and call ListBee() with no arguments.

Create a listing

1from listbee import ListBee
2
3client = ListBee(api_key="lb_...")
4
5listing = client.listings.create(
6 name="Python Fundamentals",
7 price=2900, # $29.00
8 content_type="static",
9)
10
11print(listing.id) # lst_abc123...
12print(listing.url) # https://buy.listbee.so/python-fundamentals

List orders

1orders = client.orders.list(limit=20)
2
3for order in orders.data:
4 print(order.id, order.status, order.buyer_email)
5
6# Fetch next page
7if orders.has_more:
8 next_page = client.orders.list(limit=20, cursor=orders.cursor)

Source

github.com/listbee-dev/listbee-python


TypeScript

Install

$npm install listbee

Requires Node.js 18+. Works in Deno and Bun.

Auth

1import { ListBee } from 'listbee';
2
3const client = new ListBee({ apiKey: 'lb_...' });

Or set LISTBEE_API_KEY in your environment and omit the argument.

Create a listing

1import { ListBee } from 'listbee';
2
3const client = new ListBee({ apiKey: 'lb_...' });
4
5const listing = await client.listings.create({
6 name: 'TypeScript Handbook',
7 price: 1900, // $19.00
8 content_type: 'static',
9});
10
11console.log(listing.id); // lst_abc123...
12console.log(listing.url); // https://buy.listbee.so/typescript-handbook

List orders

1const orders = await client.orders.list({ limit: 20 });
2
3for (const order of orders.data) {
4 console.log(order.id, order.status, order.buyer_email);
5}
6
7// Fetch next page
8if (orders.has_more) {
9 const nextPage = await client.orders.list({ limit: 20, cursor: orders.cursor });
10}

Source

github.com/listbee-dev/listbee-typescript


curl reference

All SDK methods map 1:1 to REST endpoints. Any example can be run with curl:

$# Create a listing
$curl -X POST https://api.listbee.so/v1/listings \
> -H "Authorization: Bearer lb_..." \
> -H "Content-Type: application/json" \
> -d '{"name": "Python Fundamentals", "price": 2900, "content_type": "static"}'
$
$# List orders
$curl https://api.listbee.so/v1/orders \
> -H "Authorization: Bearer lb_..."