# ICD-10 Codes Scraper (`maximedupre/icd-10-codes-scraper`) Actor

ICD-10 Codes Scraper for NLM Clinical Tables lookup. Search symptoms, conditions, or exact ICD-10-CM codes, then export official code names, match terms, ranks, and nullable hierarchy fields.

- **URL**: https://apify.com/maximedupre/icd-10-codes-scraper.md
- **Developed by:** [Maxime Dupré](https://apify.com/maximedupre) (community)
- **Categories:** Business, Developer tools, Education
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $6.75 / 1,000 scraped icd codes

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

### 🔎 ICD-10 codes lookup for diagnosis code exports

ICD-10 Codes Scraper looks up ICD-10-CM diagnosis codes from NLM Clinical Tables and saves one clean dataset row per matching code. Use it when you need official code names for search terms such as symptoms or conditions, or when you already have exact ICD-10-CM codes and want a repeatable export through Apify.

- **[icd-10 codes](https://apify.com/maximedupre/icd-10-codes-scraper/examples/icd-10-codes)** - search broad diagnosis words and export official ICD-10-CM code names.
- **[urinary tract infection icd 10 code](https://apify.com/maximedupre/icd-10-codes-scraper/examples/urinary-tract-infection-icd-10-code)** - look up common condition phrases and save the matching diagnosis codes.
- **[icd-10 diagnosis codes list](https://apify.com/maximedupre/icd-10-codes-scraper/examples/icd-10-diagnosis-codes-list)** - build a small source-backed list for billing tools, research, EHR autocomplete, or QA workflows.
- **[icd-10 diabetes type 2](https://apify.com/maximedupre/icd-10-codes-scraper/examples/icd-10-diabetes-type-2)** - collect matching code rows for diabetes-related lookup terms.
- **[icd-10 code for hypertension](https://apify.com/maximedupre/icd-10-codes-scraper/examples/icd-10-code-for-hypertension)** - check known clinical phrases or exact codes without wiring your own NLM Clinical Tables request.

#### 📦 Returned data

Each saved item is one successful ICD-10-CM code result. The Actor does not save error rows or placeholder rows, so your dataset stays focused on usable code matches.

Rows include:

| Field | Description |
| --- | --- |
| `code` | ICD-10-CM code returned by NLM Clinical Tables. |
| `name` | Official ICD-10-CM diagnosis name returned by the source. |
| `matchedTerm` | Search term that produced the row, or `null` for exact-code lookups. |
| `rank` | 1-based result order for search rows, or `null` for exact-code lookups. |
| `chapterCode`, `chapterTitle` | ICD-10-CM chapter data when the source provides it. |
| `blockCode`, `blockTitle` | ICD-10-CM block data when the source provides it. |
| `parentCode`, `parentName` | Parent code data when the source provides it. |

The current NLM lookup path reliably returns `code` and `name`. Hierarchy fields are included as nullable columns and are filled only when source-backed data is available.

#### 🚀 How to run it

1. Open the Actor input.
2. Add one or more values to **Search terms**, **Exact ICD-10-CM codes**, or both.
3. Set **Maximum results per search term** to control how many matches each term can save.
4. Start the Actor.
5. Open the dataset or export the results as JSON, CSV, Excel, XML, RSS, or HTML.

For a quick first run, keep the prefilled `fever`, `diabetes`, `hypertension`, and `fracture` search terms and leave the result limit at `500`.

#### ⚙️ Input

Use search terms when you want the source to find matching ICD-10-CM rows by symptom, condition, or diagnosis wording. Use exact codes when you already know the code and want to confirm the official source name.

```json
{
  "searchTerms": ["fever", "diabetes", "hypertension", "fracture"],
  "icdCodes": ["A78", "E11.9"],
  "maxItemsPerSearch": 500
}
````

Input fields:

| Field | What it does |
| --- | --- |
| `searchTerms` | Symptoms, conditions, or diagnosis words to search. |
| `icdCodes` | Exact ICD-10-CM diagnosis codes such as `A78`, `E11.9`, or `Z00.00`. |
| `maxItemsPerSearch` | Maximum saved matches per search term, from 1 to 1000. |

If both target lists are empty, the Actor stops cleanly and asks for at least one search term or exact code. Invalid exact codes are skipped instead of saved.

#### 🧾 Output example

```json
{
  "code": "A78",
  "name": "Q fever",
  "matchedTerm": "fever",
  "rank": 1,
  "chapterCode": null,
  "chapterTitle": null,
  "blockCode": null,
  "blockTitle": null,
  "parentCode": null,
  "parentName": null
}
```

Exact-code lookups use the same output shape with `matchedTerm` and `rank` set to `null`.

#### 💳 Pricing

This Actor uses pay-per-event pricing. You pay for each saved ICD-10-CM code lookup result.

The Actor does not charge for startup, empty searches, skipped invalid codes, no-result lookups, source errors, or status messages. Source-backed context returned with a saved code is included in the same event.

#### 🔌 Integrations

https://www.youtube.com/watch?v=bNACk1\_S\_6w\&list=PLObrtcm1Kw6MUrlLNDbK9QRg8VDJg0gOW\&index=4

- Run the Actor from Apify Console when you need a one-off ICD-10-CM export.
- Call the Actor from the Apify API to add code lookup to billing, claims, EHR, research, or QA workflows.
- Schedule repeat runs for terms you monitor often.
- Use webhooks to send completed datasets to your app or data pipeline.
- Export rows to JSON, CSV, Excel, XML, RSS, or HTML for spreadsheets and downstream tools.

#### ❓ FAQ

**Can I look up an exact ICD-10-CM code?**\
Yes. Add codes such as `A78`, `E11.9`, or `Z00.00` to **Exact ICD-10-CM codes**. Exact-code rows return `matchedTerm: null` and `rank: null`.

**Can I search for a condition such as diabetes or hypertension?**\
Yes. Add condition or diagnosis words to **Search terms**. The Actor saves the matching rows returned by NLM Clinical Tables, up to your per-term limit.

**Does this return ICD-10-CM hierarchy data?**\
The dataset includes nullable hierarchy fields. They are filled only when the official source path provides source-backed values. The current lookup path returns code names reliably and leaves unavailable hierarchy fields as `null`.

**Does this Actor give medical advice or billing advice?**\
No. It exports source-backed ICD-10-CM lookup data. It does not choose diagnoses, interpret symptoms, recommend billing codes, or decide clinical suitability.

**Why not use the NLM API directly?**\
Use the NLM API directly when you want to own request code, retries, exports, scheduling, and dataset handling. Use this Actor when you want Apify runs, API access, exports, schedules, webhooks, and pay-per-saved-result output without building that wrapper yourself.

**What are NLM alternatives?**\
Alternatives include direct NLM Clinical Tables calls, CMS downloads, licensed coding tools, EHR terminology services, or other Apify healthcare data actors. This Actor is focused on public NLM ICD-10-CM lookup and does not replace clinical coding software.

### 📝 Changelog

- 0.1: Initial release.

### 🆘 Support

For issues, questions, or feature requests, [file a ticket](https://console.apify.com/actors/maximedupre~icd-10-codes-scraper/issues) and I'll fix or implement it in less than 24h 🫡

### 🔗 Other actors

- [Hospital Price Transparency Scraper ↗](https://apify.com/maximedupre/hospital-price-transparency-scraper) - Export CMS hospital facility data and public payer-rate records.
- [URL to BibTeX Converter ↗](https://apify.com/maximedupre/url-to-bibtex-converter) - Convert PubMed, DOI, arXiv, article, and web page URLs into BibTeX citations.
- [World Bank Projects Scraper ↗](https://apify.com/maximedupre/world-bank-projects-scraper) - Export public World Bank project and indicator data for research workflows.
- [XML JSON Converter ↗](https://apify.com/maximedupre/xml-json-converter) - Convert XML and JSON from pasted data or public URLs into clean dataset rows.
- [RSS Feed Reader ↗](https://apify.com/maximedupre/rss-feed-reader) - Parse RSS, Atom, RDF, and JSON Feed URLs into structured feed item exports.

**Made with ❤️ by Maxime Dupré**

# Actor input Schema

## `searchTerms` (type: `array`):

Add symptoms, conditions, or diagnosis words such as fever or diabetes.

## `icdCodes` (type: `array`):

Add known ICD-10-CM diagnosis codes such as A78, E11.9, or Z00.00.

## `maxItemsPerSearch` (type: `integer`):

Limit how many matching codes each search term can save.

## Actor input object example

```json
{
  "searchTerms": [
    "fever",
    "diabetes",
    "hypertension",
    "fracture"
  ],
  "maxItemsPerSearch": 500
}
```

# Actor output Schema

## `results` (type: `string`):

Open the saved ICD-10-CM code lookup rows from the default dataset.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "searchTerms": [
        "fever",
        "diabetes",
        "hypertension",
        "fracture"
    ],
    "maxItemsPerSearch": 500
};

// Run the Actor and wait for it to finish
const run = await client.actor("maximedupre/icd-10-codes-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "searchTerms": [
        "fever",
        "diabetes",
        "hypertension",
        "fracture",
    ],
    "maxItemsPerSearch": 500,
}

# Run the Actor and wait for it to finish
run = client.actor("maximedupre/icd-10-codes-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "searchTerms": [
    "fever",
    "diabetes",
    "hypertension",
    "fracture"
  ],
  "maxItemsPerSearch": 500
}' |
apify call maximedupre/icd-10-codes-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=maximedupre/icd-10-codes-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "ICD-10 Codes Scraper",
        "description": "ICD-10 Codes Scraper for NLM Clinical Tables lookup. Search symptoms, conditions, or exact ICD-10-CM codes, then export official code names, match terms, ranks, and nullable hierarchy fields.",
        "version": "0.1",
        "x-build-id": "IVu8c0tvsWUEwbaPr"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/maximedupre~icd-10-codes-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-maximedupre-icd-10-codes-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/maximedupre~icd-10-codes-scraper/runs": {
            "post": {
                "operationId": "runs-sync-maximedupre-icd-10-codes-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/maximedupre~icd-10-codes-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-maximedupre-icd-10-codes-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "searchTerms": {
                        "title": "Search terms",
                        "uniqueItems": true,
                        "type": "array",
                        "description": "Add symptoms, conditions, or diagnosis words such as fever or diabetes.",
                        "items": {
                            "type": "string",
                            "minLength": 1
                        }
                    },
                    "icdCodes": {
                        "title": "Exact ICD-10-CM codes",
                        "uniqueItems": true,
                        "type": "array",
                        "description": "Add known ICD-10-CM diagnosis codes such as A78, E11.9, or Z00.00.",
                        "items": {
                            "type": "string",
                            "pattern": "^[A-TV-Z][0-9][0-9A-Z](\\.[0-9A-Z]{1,4})?$"
                        }
                    },
                    "maxItemsPerSearch": {
                        "title": "Maximum results per search term",
                        "minimum": 1,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Limit how many matching codes each search term can save.",
                        "default": 500
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
