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.
Inputs
Values from the run on Oct 23, 2026, shown under Output.
- Description, required
description Condition in plain words, such as "type 2 diabetes with kidney problems".
asthma
- Max Results optional
max_results Maximum number of matching codes to return, such as 10 (up to 50).
3
Whole number from 1 to 50. Default
10.
Input as JSON
{ "description": "asthma", "max_results": 3}Output
{ "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" } ]}Code
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}}' # Save as fous.py, then run: python3 fous.pyimport json, os, timefrom urllib.error import HTTPErrorfrom urllib.request import Request, urlopenAPI = "https://api.fous.com/v1/runs" KEY = os.environ["FOUS_API_KEY"]HEADERS = { "Authorization": f"Bearer {KEY}", "Content-Type": "application/json" ,}def call(url, body=None): data = json.dumps(body).encode() if body else None request = Request(url, data, HEADERS) try: with urlopen(request, timeout=120) as r: return r.status, json.load(r) except HTTPError as error: message = json.load(error)["error"]["message"] raise RuntimeError(message) from errorstatus, run = call(API, { "method": "clinicaltables.nlm.nih.gov/search_diagnosis_codes" , "input": { "description": "asthma", "max_results": 3 }})# 202: still going after 30 s. Ask again until it ends.while status == 202: time.sleep(2) status, run = call(f"{API}/{run['id']}")print(json.dumps(run["data"], indent=2))// Save as fous.mjs, then run: node fous.mjsconst api = "https://api.fous.com/v1/runs" ;const headers = { Authorization: `Bearer ${process.env.FOUS_API_KEY}`, "Content-Type": "application/json" ,};let response = await fetch(api, { method: "POST", headers, body: JSON.stringify({ "method": "clinicaltables.nlm.nih.gov/search_diagnosis_codes" , "input": { "description": "asthma", "max_results": 3 } }), signal: AbortSignal.timeout(120_000),});let run = await response.json();// 202: still going after 30 s. Ask again until it ends.while (response.status === 202) { await new Promise((done) => setTimeout(done, 2_000)); response = await fetch(`${api}/${run.id}`, { headers }); run = await response.json();}if (!response.ok) throw new Error(run.error.message);console.log(run.data);# Connect your agent to Fous once, over MCP (Streamable HTTP):# https://api.fous.com/mcp# Set FOUS_API_KEY first: create a key at https://app.fous.com/keys.# Claude Codeclaude mcp add \ --scope user \ --transport http fous https://api.fous.com/mcp \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Codexcodex mcp add fous \ --url https://api.fous.com/mcp \ --bearer-token-env-var FOUS_API_KEY# Cursor, VS Code, Windsurf, Cline and morenpx -y add-mcp https://api.fous.com/mcp -g -n fous \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Then ask your agent:# "Use Fous to run clinicaltables.nlm.nih.gov/search_diagnosis_codes# with {"description":"asthma","max_results":3}"Over HTTP, the answer’s data holds the output. A run still going after 30 seconds answers 202 with its id: ask GET /v1/runs/{id} until it ends.
Schema
Input schema
{ "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
{ "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}- Price
- 1 credit per completed run (1¢ with pay as you go); failed runs are free.
- Method
clinicaltables.nlm.nih.gov/search_diagnosis_codes- Returns
- code, official name, NLM record link
Use it from your agent
Give your agent this line. It reads SKILL.md, gets a Fous API key and connects the Fous MCP server. Its run then takes the method clinicaltables.nlm.nih.gov/search_diagnosis_codes with the inputs above.
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?
See more
All NIH methodsExplains an ICD-10-CM diagnosis code with its official name, category, chapter, and whether it is billable, using the NLM Clinical Tables diagnosis table.
clinicaltables.nlm.nih.gov/explain_diagnosis_codeFinds NIH research grants by topic, organisation, or researcher name. Searches the last five fiscal years by default.
reporter.nih.gov/search_grantsFinds PubMed medical and life-science articles by topic, with publication details and free full-text links when PubMed confirms them.
pubmed.ncbi.nlm.nih.gov/search_articlesGets 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.
pubmed.ncbi.nlm.nih.gov/get_articleLooks 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.
pubchem.ncbi.nlm.nih.gov/get_chemicalLooks 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.
pubchem.ncbi.nlm.nih.gov/get_chemical_safetyLooks 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.
medlineplus.gov/get_health_topicFinds 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.
webmd.com/get_condition