# Aapc — 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.

> Access comprehensive medical coding information including CPT, ICD-10-CM, ICD-10-PCS, and HCPCS codes with detailed hierarchies, sections, and code-specific details. Search across all medical coding systems to find the exact codes and their descriptions for billing, documentation, and compliance purposes.

**Category:** Healthcare | **Website:** [aapc.com/](https://aapc.com/) | **Docs:** [parse.bot/marketplace/85e7680c-8d6e-46b3-970e-a9f841c8c1cf/aapc-com-api](https://parse.bot/marketplace/85e7680c-8d6e-46b3-970e-a9f841c8c1cf/aapc-com-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-aapc-com-api-85e7680c/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_cpt_code_detail

Get details for a specific CPT code including description, lay term, and breadcrumbs showing the code's position in the hierarchy.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `code` | string | Yes | CPT code (e.g., '99213', '27447'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-aapc-com-api-85e7680c/get_cpt_code_detail \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"code":"<string>"}'
```

### get_cpt_full_hierarchy

Get nested CPT hierarchy starting from top-level sections and drilling down into subsections. The max_depth parameter controls how many levels deep to recurse. At depth 1 returns only top-level sections; at depth 2 includes subsections; at depth 3 includes sub-subsections.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `max_depth` | integer | No | Maximum depth to traverse (1 = top-level sections only, 2 = sections + subsections, 3 = sections + subsections + sub-subsections). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-aapc-com-api-85e7680c/get_cpt_full_hierarchy \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"max_depth":"<integer>"}'
```

### get_cpt_section_detail

Get subsections within a CPT range. Returns child ranges for a given top-level CPT section range obtained from get_cpt_sections. Each subsection contains a label, range, and URL for further drill-down.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `range` | string | Yes | CPT code range from get_cpt_sections (e.g., '98000-99499', '10004-69990'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-aapc-com-api-85e7680c/get_cpt_section_detail \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"range":"<string>"}'
```

### get_cpt_sections

Get top-level CPT code sections. Returns the major CPT code categories (e.g., Anesthesia, Surgery, Radiology, Evaluation and Management). Each section contains a label, code range, and URL.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-aapc-com-api-85e7680c/get_cpt_sections \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_cpt_subsection_codes

Get individual codes within a CPT subsection at the leaf level. The range must be an exact leaf-level range from get_cpt_section_detail (e.g., '99202-99205'). Supports pagination; each page returns up to 10 codes.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `page` | integer | No | Page number (0-indexed). Each page returns up to 10 codes. Use next_page from the response to determine if more pages exist. |
| `range` | string | Yes | Leaf-level CPT code range from get_cpt_section_detail or further drill-down (e.g., '99202-99205'). Must match the exact range the site uses. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-aapc-com-api-85e7680c/get_cpt_subsection_codes \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"page":"<integer>","range":"<string>"}'
```

### get_hcpcs_section_detail

Get codes within an HCPCS section. Use the range ID from get_hcpcs_sections. Returns individual HCPCS codes with their label, description, and URL.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `range` | string | Yes | HCPCS section ID from get_hcpcs_sections (e.g., '5', '4', '3'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-aapc-com-api-85e7680c/get_hcpcs_section_detail \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"range":"<string>"}'
```

### get_hcpcs_sections

Get top-level HCPCS Level II sections. Section ranges are opaque numeric IDs rather than HCPCS code ranges.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-aapc-com-api-85e7680c/get_hcpcs_sections \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_icd10cm_code_detail

Get details for an ICD-10-CM code or category including description, excludes1, excludes2, and includes notes. Excludes and includes data is available primarily at the category level (e.g., 'J18', 'E11') rather than at specific leaf codes.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `code` | string | Yes | ICD-10-CM code or category (e.g., 'J18', 'E11', 'A01.0'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-aapc-com-api-85e7680c/get_icd10cm_code_detail \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"code":"<string>"}'
```

### get_icd10cm_section_detail

Get subsections within an ICD-10-CM chapter or block. Returns child ranges for a given chapter range obtained from get_icd10cm_sections.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `range` | string | Yes | ICD-10-CM range from get_icd10cm_sections (e.g., 'A00-B99', 'C00-D49'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-aapc-com-api-85e7680c/get_icd10cm_section_detail \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"range":"<string>"}'
```

### get_icd10cm_sections

Get top-level ICD-10-CM chapters. Returns all ICD-10-CM chapter groupings with their label, range, and URL.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-aapc-com-api-85e7680c/get_icd10cm_sections \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_icd10pcs_detail

Get next level sub-codes in ICD-10-PCS hierarchy. Each sub-code may appear as two entries with the same code but different labels (one is the code string, one is the descriptive name).

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `code_prefix` | string | Yes | ICD-10-PCS code prefix from get_icd10pcs_sections or a previous get_icd10pcs_detail call (e.g., '0', '0B'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-aapc-com-api-85e7680c/get_icd10pcs_detail \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"code_prefix":"<string>"}'
```

### get_icd10pcs_sections

Get top-level ICD-10-PCS sections (Character 1). Returns single-character section codes with their label and URL.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-aapc-com-api-85e7680c/get_icd10pcs_sections \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### search_codes

Search for medical codes by keyword or code across all code sets (ICD-10-CM, CPT, HCPCS). Returns a nested treeview structure with results grouped by code set. Labels in the treeview contain inline HTML.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | Yes | Search keyword or code (e.g., 'typhoid', 'pneumonia', '99213'). |
| `year` | string | No | Code year for the search dataset. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-aapc-com-api-85e7680c/search_codes \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"<string>","year":"<string>"}'
```
