# NIH API: Search diagnosis codes

> Finds ICD-10-CM diagnosis codes and official names from a plain-language condition description, retrying with simplified wording when the first search finds nothing.

Unofficial. Not affiliated with or endorsed by NIH.

- Page: https://fous.com/methods/clinicaltables.nlm.nih.gov/search-diagnosis-codes
- Method: `clinicaltables.nlm.nih.gov/search_diagnosis_codes`, version 1
- Website: clinicaltables.nlm.nih.gov
- Returns: code, official name, NLM record link
- Effect: read (it gets data and changes nothing)
- Sign-in: none needed
- Cost: 1 credit per completed run (1¢ with pay as you go); failed runs are free
- Verified: Nov 2, 2026

## Inputs

| Field | Type | Required | In the run below | Description |
|---|---|---|---|---|
| `description` | string | yes | `"asthma"` | Condition in plain words, such as "type 2 diabetes with kidney problems". |
| `max_results` | integer | no | `3` | Maximum number of matching codes to return, such as 10 (up to 50). Default 10. |

## Output

From a run on Oct 23, 2026. Its input:

```json
{
  "description": "asthma",
  "max_results": 3
}
```

Its output:

```json
{
  "diagnosis_codes": [
    {
      "code": "J45.998",
      "page_url": "https://clinicaltables.nlm.nih.gov/api/icd10cm/v3/search?terms=J45.998&sf=code&df=code%2Cname&count=1",
      "official_name": "Other asthma"
    },
    {
      "code": "J82.83",
      "page_url": "https://clinicaltables.nlm.nih.gov/api/icd10cm/v3/search?terms=J82.83&sf=code&df=code%2Cname&count=1",
      "official_name": "Eosinophilic asthma"
    },
    {
      "code": "J45.909",
      "page_url": "https://clinicaltables.nlm.nih.gov/api/icd10cm/v3/search?terms=J45.909&sf=code&df=code%2Cname&count=1",
      "official_name": "Unspecified asthma, uncomplicated"
    }
  ]
}
```

## Run it

From code, with a Fous API key in `FOUS_API_KEY`; the answer's `data` holds the output:

```bash
curl https://api.fous.com/v1/runs \
  -H "Authorization: Bearer $FOUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"method":"clinicaltables.nlm.nih.gov/search_diagnosis_codes","input":{"description":"asthma","max_results":3}}'
```

From an AI agent connected to the Fous MCP server: its `run` with the same method and input. To connect one, give it `set up https://fous.com/SKILL.md`.

## Ask your agent

- Find the ICD-10-CM code for type 2 diabetes with kidney complications
- What's the diagnosis code for chronic migraine without aura?
- Look up official ICD-10 names for asthma with acute exacerbation, return up to 5 matches
- I need the billing code for iron deficiency anemia secondary to blood loss on nih.gov
- Which ICD-10-CM codes match 'pneumonia due to influenza', and can I get the NLM record links?

## Input schema

```json
{
  "type": "object",
  "required": [
    "description"
  ],
  "properties": {
    "description": {
      "type": "string",
      "minLength": 1,
      "description": "Condition in plain words, such as \"type 2 diabetes with kidney problems\"."
    },
    "max_results": {
      "type": "integer",
      "default": 10,
      "maximum": 50,
      "minimum": 1,
      "description": "Maximum number of matching codes to return, such as 10 (up to 50).",
      "x-fous-developer": true
    }
  },
  "additionalProperties": false
}
```

## Output schema

```json
{
  "type": "object",
  "required": [
    "diagnosis_codes"
  ],
  "properties": {
    "diagnosis_codes": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "code",
          "official_name",
          "page_url"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "ICD-10-CM diagnosis code used on forms."
          },
          "page_url": {
            "type": "string",
            "description": "NLM record lookup link for this code."
          },
          "official_name": {
            "type": "string",
            "description": "Official ICD-10-CM diagnosis name."
          }
        },
        "additionalProperties": false
      },
      "description": "Matching ICD-10-CM diagnosis codes, best match first."
    }
  },
  "additionalProperties": false
}
```

## See more

- [NIH API: Explain ICD-10-CM diagnosis code](https://fous.com/methods/clinicaltables.nlm.nih.gov/explain-diagnosis-code.md): Explains an ICD-10-CM diagnosis code with its official name, category, chapter, and whether it is billable, using the NLM Clinical Tables diagnosis table.
- [NIH API: Search grants](https://fous.com/methods/reporter.nih.gov/search-grants.md): Finds NIH research grants by topic, organisation, or researcher name. Searches the last five fiscal years by default.
- [NIH API: Search PubMed articles](https://fous.com/methods/pubmed.ncbi.nlm.nih.gov/search-articles.md): Finds PubMed medical and life-science articles by topic, with publication details and free full-text links when PubMed confirms them.
- [NIH API: Get PubMed article](https://fous.com/methods/pubmed.ncbi.nlm.nih.gov/get-article.md): Gets the full PubMed abstract and publication details for one article by title, PubMed link, or PubMed number (PMID). A title is searched in PubMed titles first and must closely match a found article. Some articles have no abstract or free full text.
- [NIH API: Get chemical facts by name or CAS number](https://fous.com/methods/pubchem.ncbi.nlm.nih.gov/get-chemical.md): Looks up a chemical on PubChem by common name or CAS number and returns its formula, molecular weight, names, description, SMILES, InChIKey and 2D structure image link.
- [NIH API: Get chemical safety](https://fous.com/methods/pubchem.ncbi.nlm.nih.gov/get-chemical-safety.md): Looks up a chemical on PubChem by name or CAS number and returns its GHS hazard labels, route-specific first aid, flash point and workplace exposure limits.
- [MedlinePlus API: Get health topic](https://fous.com/methods/medlineplus.gov/get-health-topic.md): Looks up a MedlinePlus health topic for a condition or symptom and returns its overview, related topics, and encyclopedia sections when a matching article is linked.
- [WebMD API: Get condition guide](https://fous.com/methods/webmd.com/get-condition.md): Finds WebMD's main guide for a condition through a Bing search. Returns its overview and its symptoms, causes, diagnosis, treatment and when-to-call-a-doctor sections.
- [All NIH methods](https://fous.com/methods/nih.gov.md)
