API for ICD-9-CM, Diagnoses

ICD-9-CM (International Classification of Diseases, Ninth Revision, Clinical Modification) is a medical coding system for classifying diagnoses and reasons for visits in U.S. health care settings.

API Demo

The following demo shows how this API might be used with an autocompleter we've developed.

For further experimentation with the autocompleter and this API, try the autocompleter demo page.

API Documentation

API Base URL: https://clinicaltables.nlm.nih.gov/api/icd9cm_dx/v3/search (+ query string parameters)

This data set may also be accessed through the FHIR ValueSet $expand operation.

In addition to the base URL, you will need to specify other parameters. See the query string parameters section below for details.

Query String Parameters and Default Values

At a minimum, when using the above base URL, you will need to specify the "terms" parameter containing a word or partial word to match.

Parameter NameDefault ValueDescription
terms(Required.) The search string (e.g., just a part of a word) for which to find matches in the list. More than one partial word can be present in "terms", in which case there is an implicit AND between them.
maxList Optional, with a default of 7. Specifies the number of results requested, up to the upper limit of 500. If present but the value is empty, 500 will be used.
qAn optional, additional query string used to further constrain the results returned by the "terms" field. Unlike the terms field, "q" is not automatically wildcarded, but can include wildcards and can specify field names. See the Elasticsearch query string page for documentation of supported syntax.
dfcode_dotted, long_nameA comma-separated list of display fields (from the fields section below) which are intended for the user to see when looking at the results.
sfcode, code_dotted, short_name, long_nameA comma-separated list of fields to be searched.
cfcodeA field to regard as the "code" for the returned item data.
efA comma-separated list of additional fields to be returned for each retrieved list item. (See the Output format section for how the data for fields is returned.) If you wish the keys in the returned data hash to be something other than the field names, you can specify an alias for the field name by separating it from its field name with a colon, e.g., "ef=field_name1:alias1,field2,field_name3:alias3,etc. Note that not every field specified in the ef parameter needs to have an alias.

ICD-9-CM Diagnoses Field Descriptions

FieldField Description
codeThe ICD-9-CM diagnosis code, e.g., 0011, V092
code_dottedThe decimal version of the ICD-9-CM diagnosis code, e.g., 001.1, V09.2
short_nameThe abbreviated name of the diagnosis.
long_nameThe full name of the diagnosis.

Output format

Output for an API query is an array of the following elements:

  1. The total number of results on the server (which can be more than the number returned). For APIs in which there are millions of records, this number might be a lower bound due to early termination if there are more than a hundred thousand results.
  2. An array of codes for the returned items. (This is the field specified with the cf query parameter above.)
  3. A hash of the "extra" data requested via the "ef" query parameter above. The keys on the hash are the fields (or their requested aliases) named in the "ef" parameter, and the value for a field is an array of that field's values in the same order as the returned codes.
  4. An array, with one element for each returned code, where each element is an array of the display strings specified with the "df" query parameter.
  5. An array, with one element for each returned code, where each element is the "code system" for the returned code. Note that only code-system aware APIs will return this array.

Sample API Queries

QueryResultDescription
https://clinicaltables.nlm.nih.gov/api/icd9cm_dx/v3/search?terms=08[51,["0820","08241","0831","0841","0846","0850","0855"],null,[["0820"," Spotted fevers"],["08241"," Ehrlichiosis chafeensis [E. chafeensis]"],["0831"," Trench fever"],["0841"," Vivax malaria [benign tertian]"],["0846"," Malaria, unspecified"],["0850"," Visceral [kala-azar] leishmaniasis"],["0855"," Mucocutaneous leishmaniasis, (American)"]]] Returns a list of 7 (out of 51 total) ICD-9-CM diagnosis codes and names where the code starts with "08".
https://clinicaltables.nlm.nih.gov/api/icd9cm_dx/v3/search?terms=brai&ef=short_name[120,["1917","2375","3109","3489","3484","01331","01336"],{"short_name":[" Mal neo brain stem"," Unc beh neo brain/spinal"," Nonpsychot brain syn NOS"," Brain condition NOS"," Compression of brain"," TB brain abscess-no exam"," TB brain absc-oth test"]},[["1917"," Malignant neoplasm of brain stem"],["2375"," Neoplasm of uncertain behavior of brain and spinal cord"],["3109"," Unspecified nonpsychotic mental disorder following organic brain damage"],["3489"," Unspecified condition of brain"],["3484"," Compression of brain"],["01331"," Tuberculous abscess of brain, bacteriological or histological examination not done"],["01336"," Tuberculous abscess of brain, tubercle bacilli not found by bacteriological or histological examination, but tuberculosis confirmed by other methods [inoculation of animals]"]]] Returns a list of 7 (out of 120 total) ICD-9-CM diagnosis codes and names where the names (or other searchable fields) contain words beginning with "brai". Note that the "ef=short_name" parameter caused the short_name (abbreviated names) to be returned as well.