# Wcotradetools — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Quickly look up official HS 2022 product classifications, browse the complete hierarchy of sections, chapters, headings, and subheadings, and search for specific commodity codes used in international trade. Organize product data with standardized, normalized classification information perfect for inventory systems and customs documentation.

**Category:** Government & Public Data | **Website:** [www.wcotradetools.org/en/harmonized-system](https://www.wcotradetools.org/en/harmonized-system) | **Docs:** [parse.bot/marketplace/738099fe-c5f1-4583-b400-5258e5552a7d/wcotradetools-org-api](https://parse.bot/marketplace/738099fe-c5f1-4583-b400-5258e5552a7d/wcotradetools-org-api)

Pay-per-use API proxy for Locus Pro. Each call burns credits from your workspace balance.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/credits/wcotradetools/`
**Auth:** `Authorization: Bearer <LOCUS_CREDITS_SECRET_KEY>` (an `lcr_` secret key or a scoped `lcac_` agent credential)
**Required header:** `Idempotency-Key: <fresh UUID per call>`. A retry with the same key replays the stored result without a new charge.
**Response:** the provider response after any endpoint-specific normalization. `X-Locus-Credits-Charged` carries the charge and `X-Locus-Credits-Balance` the remaining balance. Insufficient credits return `402` before the provider is called.
**Pricing:** estimated costs below are USD. Locus debits the credit equivalent at your workspace rate.

Full call contract: https://docs.paywithlocus.com/api-reference/introduction

> Using a Pay With Locus wallet key (`claw_` prefix)? Wallet routes are documented separately: https://docs.paywithlocus.com/wrapped-apis/for-agents

## Endpoints

### Get chapters

Get all chapters within a given HS 2022 section. Returns 2-digit chapter codes and descriptions along with parent section info. Each section contains between 1 and 15 chapters.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `section_code` | string | Yes | Roman numeral section code. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/wcotradetools/get-chapters \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"section_code":"<string>"}'
```

### Get headings and subheadings

Get all headings (4-digit codes) and subheadings (6-digit codes) for a given chapter. Returns flat records with full hierarchy context (section, chapter, heading, subheading). Fetches multiple levels from the classification tree so response time increases with chapter complexity. When section_code is omitted, all sections are searched sequentially to find the chapter.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `chapter_code` | string | Yes | 1- or 2-digit chapter code (e.g., '01', '9', '93', '97'). Leading zeros are normalized internally. |
| `section_code` | string | No | Roman numeral section code to limit the search scope. If omitted, all sections are searched to find the chapter. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/wcotradetools/get-headings-and-subheadings \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"chapter_code":"<string>","section_code":"<string>"}'
```

### Get sections

List all 21 HS 2022 sections with their Roman numeral codes and descriptions. Returns the complete top-level classification hierarchy. No pagination — always returns all 21 sections in one response.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/wcotradetools/get-sections \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Search hs codes

Search HS 2022 classification by keyword or code. Returns up to 10 matching results ranked by relevance with type, code, hierarchy path, and excerpt showing match context. Supports both text queries ('coffee', 'live animals') and numeric code lookups ('0901').

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | Yes | Search keyword or HS code (e.g., 'coffee', 'live animals', '0901'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/wcotradetools/search-hs-codes \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"query":"<string>"}'
```

## Next steps

- [All wrapped API providers](https://paywithlocus.com/wapi/index.md): pick another provider.
- [Find and call tools](https://paywithlocus.com/agent/tools.md): price ceilings, async results, and errors.
- [Credits and billing](https://paywithlocus.com/agent/billing.md): what a call costs and how to add credits.
- [Agent docs index](https://paywithlocus.com/agent/index.md): every Locus agent page.