Skip to main content

Installation

// npm
npm install @channel3/sdk

// yarn
yarn add @channel3/sdk

// pnpm
pnpm add @channel3/sdk
# pip
pip install channel3-sdk

# uv
uv add channel3-sdk

Authentication

You can provide your API key using the CHANNEL3_API_KEY environment variable, or by passing it directly to the client.
import Channel3 from "@channel3/sdk";

// Initialize with environment variable
const client = new Channel3();

// Or, initialize with API key directly
const clientWithKey = new Channel3({
  apiKey: "your_api_key_here",
});
from channel3_sdk import Channel3, AsyncChannel3

# Initialize with environment variable
client = Channel3()

# Or, initialize with API key directly
client_with_key = Channel3(api_key="your_api_key_here")

# Async client
async_client = AsyncChannel3()

Default locale

Set a default locale once on the client and it’ll apply to every search and product detail call. Per-call values (e.g. config.country on search, ?country= on product detail) override the client default.
import Channel3 from "@channel3/sdk";

const client = new Channel3({
  country: "GB",
  currency: "GBP",
});

// Uses GB / GBP
await client.products.search({ query: "raincoat" });

// Override per-call (returns DE / EUR offers regardless of the client default)
await client.products.search({
  query: "raincoat",
  config: { country: "DE", currency: "EUR" },
});
from channel3_sdk import Channel3

client = Channel3(country="GB", currency="GBP")

client.products.search(query="raincoat")

client.products.search(
    query="raincoat",
    config={"country": "DE", "currency": "EUR"},
)
You can also set defaults via environment variables: CHANNEL3_LANGUAGE, CHANNEL3_COUNTRY, CHANNEL3_CURRENCY. The same pattern applies to dimension units — set lengthUnit / weightUnit on the client (or CHANNEL3_LENGTH_UNIT / CHANNEL3_WEIGHT_UNIT) to choose the units dimensions come back in. See Dimension units.
When only country is set, the server infers currency (e.g. GBGBP) and language (e.g. GBen). When all three are unset, defaults to en / US / USD.

Usage

All top-level endpoints are available as properties on the client. For example, to use the search endpoint:
import Channel3 from "@channel3/sdk";

const client = new Channel3();

async function main() {
  const response = await client.products.search({
    query: "organic cotton t-shirt",
  });

  console.log(response);
}

main();
from channel3_sdk import Channel3

client = Channel3()

def main():
    response = client.products.search(
        query="organic cotton t-shirt"
    )
    print(response)

if __name__ == "__main__":
    main()

Async usage

import Channel3 from "@channel3/sdk";

const client = new Channel3();

async function main() {
  const response = await client.products.search({
    query: "organic cotton t-shirt",
  });
  console.log(response);
}

main();
import asyncio
from channel3_sdk import AsyncChannel3

client = AsyncChannel3()

async def main():
    response = await client.products.search(
        query="organic cotton t-shirt"
    )
    print(response)

if __name__ == "__main__":
    asyncio.run(main())

Advanced SDK usage

Filters, pagination, image search, product detail, brands, categories, and error handling.