API for ICD-11
According to The World Health Organization, "the International Classification of Diseases and Related Health Problems (ICD) is a tool for recording, reporting and grouping conditions and factors that influence health. It contains categories for diseases and disorders, health related conditions, external causes of illness or death, anatomy, sites, activities, medicines, vaccines and more." Learn more about ICD-11.
This service is provided "as is" and free of charge. Please see the Frequently Asked Questions page for more details on terms of service, etc.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/icd11_codes/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 Name | Default Value | Description |
---|---|---|
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 | 7 | 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. Note that this parameter does not support pagination, see "count" and "offset" below for details on pagination support. |
count | 7 | The number of results to retrieve (page size). The maximum count allowed is 500, see "offset" below on pagination support. |
offset | 0 | The starting result number (0-based) to retrieve. Use offset and count together for pagination. Note that the current limit on the total number of results that can be retrieved (offset + count) is 7,500. We reserve the right to decrease or increase this limit based on system capacity and/or other factors. Please see the FAQ page on how to sign up to our email list to be notified of any changes or new features. |
q | An 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. | |
type | Specify what type(s) of codes to search. Use "stem" for stem codes only, use "extension" for extension codes only, and use "category" for both stem and extension codes. When this parameter is not provided, the default is "category". | |
df | code, title, type | A comma-separated list of display
fields (from the fields section below) which are
intended for the user to see when looking at the results. The parameter "ef" (see below) may also be used to specify the data fields to retrieve. The main difference is that the value of "df" is always a string (for display), while the value for "ef" could be a json object when the field value has a complex structure. |
sf | code, title | A comma-separated list of fields to be searched. |
cf | code | A field to regard as the "code" for the returned item data. |
ef | A 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. The parameter "df" (see above) may also be used to specify the data fields to retrieve. The main difference is that the value of "df" is always a string (for display), while the value for "ef" could be a json object when the field value has a complex structure. |
ICD-11 Field Descriptions
Field | Field Description |
---|---|
code | The ICD-11 code for the record. |
title | The title/name for the code. |
definition | The definition text for the code. |
type | Code type, "stem" for stem code and "extension" for extension code. |
chapter | The ICD11 chapter number the code appears in. |
entityId | The entity id (URI) in the linearization context. |
source | The Foundation URI for the code as defined by WHO. |
browserUrl | The Foundation URI as defined by WHO. |
parent | The Linearization (release) URI as defined by WHO. |
Output format
Output for an API query is an array of the following elements:
- The total number of results on the server, which can be more than the number of results returned. This reported total number of results may also be significantly less than the actual number of results and is limited to 10,000, which may significantly improve the service response time.
- An array of codes for the returned items. (This is the field specified with the cf query parameter above.)
- 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.
- 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.
- 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
Query | Result | Description |
---|---|---|
https://clinicaltables.nlm.nih.gov/api/icd11_codes/v3/search?terms=heart | [ 134, ["XA6H07","LA80.3","QB25","XA0QB6","XA6CK2","1B12.0","2B56.0"], null, [ ["XA6H07","Heart","extension"],["LA80.3","Extrathoracic heart","stem"],["QB25","Heart donor","stem"], ["XA0QB6","Heart valve","extension"],["XA6CK2","Heart wall","extension"], ["1B12.0","Tuberculosis of heart","stem"],["2B56.0","Angiosarcoma of heart","stem"]]] | Returns a complete count of the 134 results that match the string "heart", displaying both the ICD-11 code and its associated term for the first 7 terms. |
https://clinicaltables.nlm.nih.gov/api/icd11_codes/v3/search?df=code,browserUrl&terms=blo&maxList=5 | [ 269, ["3A00.0","3A00.0Z","3A81.1","3C0Y","3C0Z"], null, [ ["3A00.0", "https://icd.who.int/browse11/l-m/en#/http%3a%2f%2fid.who.int%2ficd%2fentity%2f942744561"], ["3A00.0Z", "https://icd.who.int/browse11/l-m/en#/http%3a%2f%2fid.who.int%2ficd%2fentity%2f942744561%2fmms%2funspecified"], ["3A81.1", "https://icd.who.int/browse11/l-m/en#/http%3a%2f%2fid.who.int%2ficd%2fentity%2f1211987132"], ["3C0Y", "https://icd.who.int/browse11/l-m/en#/http%3a%2f%2fid.who.int%2ficd%2fentity%2f1766440644%2fmms%2fother"], ["3C0Z", "https://icd.who.int/browse11/l-m/en#/http%3a%2f%2fid.who.int%2ficd%2fentity%2f1766440644%2fmms%2funspecified"]]] | Returns the first 5 (of 269) ICD-11 codes beginning with "blo" and their associated FoundationURIs (when available). |