# 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. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-wcotradetools-org-api-738099fe/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## 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/parse-wcotradetools-org-api-738099fe/get_chapters \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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/parse-wcotradetools-org-api-738099fe/get_headings_and_subheadings \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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/parse-wcotradetools-org-api-738099fe/get_sections \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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/parse-wcotradetools-org-api-738099fe/search_hs_codes \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"<string>"}'
```
