Help
Web Services
The DailyMed RESTful API is a web service for accessing current SPL information. It is implemented using HTTP and can be thought of as a collection of resources, specified as URIs. Some characteristics of the DailyMed RESTful API:
- The base URI for the web service is http://dailymed.nlm.nih.gov/dailymed/services/.
- The web service is versioned, and the version number must be included after the base URI. Currently all resources are version v1.
- The service can return data in XML or JSON format. You can specify which format by appending the appropriate extension (.xml or .json) to the URI.
- A sample URI is: http://dailymed.nlm.nih.gov/dailymed/services/v1/ndc/{ndc}/spls.xml
- The web service only supports the HTTP method GET, since the web service function is to retrieve data from DailyMed.
The following table lists all currently available resources. Note that the base URI and file extensions are omitted from the table for readability.
RESTful Web Service Resource | Description |
---|---|
/ndc/{ndc}/spls | Returns a list of all SPLs with the given NDC. |
/ndc/{ndc}/imprintdata | Returns imprint data associated with the given NDC. |
/drugname/{name}/{label_type}/spls | Returns a list of all SPLs with the given drug name. |
Errors are returned using standard HTTP error code syntax. Additional information is included in the response header. The following table lists standard API errors.
Code | Description |
---|---|
404 | Not Found. |
415 | Unsupported Media Type. |
5xx | Server Error. |
Resource "/ndc/{ndc}/spls"
Returns a list of all SPLs with the given NDC.
Versions: 1
Parameters- ndc - An NDC to receive a list of SPLs from. This parameter is required.
- XML: http://dailymed.nlm.nih.gov/dailymed/services/v1/ndc/{ndc}/spls.xml
- JSON: http://dailymed.nlm.nih.gov/dailymed/services/v1/ndc/{ndc}/spls.json
- 404 NO SPLs found for NDC={ndc}
http://dailymed.nlm.nih.gov/dailymed/services/v1/ndc/0409-3613-01/spls.xmlreturns
<?xml version="1.0" encoding="UTF-8"?> <spls> <spl> <setid>7a8d2539-4422-4312-0298-207ef1a2948e</setid> <spl_version>13</spl_version> <published_date>July 29, 2011</published_date> <title> BUPIVACAINE (BUPIVACAINE HYDROCHLORIDE) INJECTION, SOLUTION [HOSPIRA, INC.] </title> </spl> <spl> <setid>37b06767-8539-4407-8c96-b93b9c4bbb4a</setid> <spl_version>2</spl_version> <published_date>June 8, 2011</published_date> <title> SPINAL 24G EUROPEAN PENCIL POINT (REGIONAL ANESTHESIA KIT) KIT [SMITHS MEDICAL ASD, INC.] </title> </spl> <spl> <setid>434f9899-a166-47f6-bdeb-e5ea7cd3fe62</setid> <spl_version>3</spl_version> <published_date>June 11, 2011</spl_version> <title> SPINAL 24G EUROPEAN PENCIL POINT (REGIONAL ANESTHESIA KIT) KIT [SMITHS MEDICAL ASD, INC.] </title> </spl> </spls>JSON:
http://dailymed.nlm.nih.gov/dailymed/services/v1/ndc/0409-3613-01/spls.jsonreturns
{ "COLUMNS" : [ "SETID", "SPL_VERSION", "TITLE", "PUBLISHED_DATE" ], "DATA" : [ [ "7a8d2539-4422-4312-0298-207ef1a2948e", 13, "BUPIVACAINE (BUPIVACAINE HYDROCHLORIDE) INJECTION, SOLUTION [HOSPIRA, INC.]", "July 29, 2011" ], [ "37b06767-8539-4407-8c96-b93b9c4bbb4a", 2, "SPINAL 24G EUROPEAN PENCIL POINT (REGIONAL ANESTHESIA KIT) KIT [SMITHS MEDICAL ASD, INC.]", "June 8, 2011" ], [ "434f9899-a166-47f6-bdeb-e5ea7cd3fe62", 3, "SPINAL 24G EUROPEAN PENCIL POINT (REGIONAL ANESTHESIA KIT) KIT [SMITHS MEDICAL ASD, INC.]", "June 1, 2011" ] ] }
Resource "/ndc/{ndc}/imprintdata"
Returns imprint data associated with the given NDC.
Versions: 1
Parameters- ndc - An NDC to receive imprint data from. This parameter is required.
- XML: http://dailymed.nlm.nih.gov/dailymed/services/v1/ndc/{ndc}/imprintdata.xml
- JSON: http://dailymed.nlm.nih.gov/dailymed/services/v1/ndc/{ndc}/imprintdata.json
- 404 NO SPLs found for NDC={ndc}
http://dailymed.nlm.nih.gov/dailymed/services/v1/ndc/0003-5168-11/imprintdata.xmlreturns
<?xml version="1.0" encoding="UTF-8"?> <spls> <spl> <setid>b512c6ce-4b4f-a93e-293a68eda6b5</setid> <spl_version>1</spl_version> <published_date>November 17, 2006</published_date> <products> <product> <code>0003-5168</code> <name>Aspirin</name> <splcolor>WHITE</splcolor> <color_text>WHITE( WHITE )</color_text> <splshape>OVAL</splshape> <shape_text>OVAL</shape_text> <splsize>10 MM</splsize> <splsymbol>false</splsymbol> <splscore>1</splscore> <splcoating>true</splcoating> </product> <product> <code>0003-5168</code> <name>pravastatin sodium</name> <splcolor>YELLOW</splcolor> <color_text>YELLOW( YELLOW )</color_text> <splshape>RECTANGLE</splshape> <shape_text>RECTANGLE</shape_text> <splsize>8 MM</splsize> <splsymbol>false</splsymbol> <splscore>1</splscore> <splcoating>false</splcoating> </product> </products> </spls> </spl>JSON:
http://dailymed.nlm.nih.gov/dailymed/services/v1/ndc/0003-5168-11/imprintdata.jsonreturns
{ "COLUMNS" : [ "SETID", "SPL_VERSION", "NAME", "PRODUCT_CODE", "SPLCOLOR", "COLOR_TEXT", "SPLIMPRINT", "SPLSHAPE", "SHAPE_TEXT", "SPLSIZE", "SPLSCORE", "SPLSYMBOL", "SPLCOATING", "PUBLISHED_DATE" ], "DATA" : [ [ "b512c6ce-5b32-4b4f-a93e-293a68eda6b5", 1, "pravastatin sodium", "0003-5168", "YELLOW", "YELLOW( YELLOW )", "P;PRAVACHOL;20", "RECTANGLE", "RECTANGLE", "8 MM", 1.0, false, false, "November 17, 2006" ], [ "b512c6ce-5b32-4b4f-a93e-293a68eda6b5", 1, "Aspirin", "0003-5168", "WHITE", "WHITE( WHITE )", "b", "OVAL", "OVAL", "10 MM", 1.0, false, true, "November 17, 2006" ] ] }
Resource "/drugname/{name}/{label_type}/spls"
Returns a list of all SPLs with the given drug name.
Versions: 1
Return Formats- XML: http://dailymed.nlm.nih.gov/dailymed/services/v1/drugname/{name}/spls.xml
- JSON: http://dailymed.nlm.nih.gov/dailymed/services/v1/drugname/{name}/spls.json
Parameters
- name - Drug name to receive a list of SPLs from. This parameter is required.
- label_type - Filter results by a specified label type. This parameter is optional. The following table shows a list of supported label types.
Label Type Description rxonly Prescription drugs only. otc OTC drugs only. human Human drugs only. human/rxonly Human prescription drugs only. human/otc Human OTC drugs only. animal Animal drugs only.
- 404 NO SPLs found for drugname={name}
http://dailymed.nlm.nih.gov/dailymed/services/v1/drugname/sanctura%20xr/spls.xmlreturns
<?xml version="1.0" encoding="UTF-8"?> <spls> <spl> <setid>5bc62cef-1c78-4ddb-bdde-0574e5218f63</setid> <spl_version>6</spl_version> <published_date>October 11, 2011</published_date> <title> SANCTURA XR (TROSPIUM CHLORIDE) CAPSULE, EXTENDED RELEASE [ALLERGAN, INC. ] </title> </spl> <spl> <setid>b7f27114-5d3c-4a78-a7dc-3e690a4aa1de</setid> <spl_version>2</spl_version> <published_date>October 17, 2011</published_date> <title> SANCTURA XR (TROSPIUM CHLORIDE) CAPSULE, EXTENDED RELEASE [PHYSICIANS TOTAL CARE, INC.] </title> </spl> </spls>JSON:
http://dailymed.nlm.nih.gov/dailymed/services/v1/drugname/sanctura%20xr/spls.jsonreturns
{ "COLUMNS": [ "SETID", "TITLE", "SPL_VERSION", "PUBLISHED_DATE" ], "DATA": [ [ "5bc62cef-1c78-4ddb-bdde-0574e5218f63", "SANCTURA XR (TROSPIUM CHLORIDE) CAPSULE, EXTENDED RELEASE [ALLERGAN, INC. ]", 6, "October 11, 2011" ], [ "b7f27114-5d3c-4a78-a7dc-3e690a4aa1de", "SANCTURA XR (TROSPIUM CHLORIDE) CAPSULE, EXTENDED RELEASE [PHYSICIANS TOTAL CARE, INC.]", 2, "October 17, 2011" ] ] }
Advanced Search
The Advanced Search page allows you to conduct a more powerful search. It supports the use of Boolean logic (AND, OR, NOT operations) and field searching.
Current fields that can be searched include:
Search Field | Description |
---|---|
NAME | Drug Name |
CLASS | Pharmacologic Class |
INGREDIENT | Ingredient |
LABEL_TYPE | Label Type (Human, Animal, etc.) |
INDICATIONS | Indications & Usage Section |
CONTRAINDICATIONS | Contraindications Section |
ADVERSE_REACTIONS | Adverse Reactions Section |
WARNINGS | Warnings & Precautions Section |
BOXED_WARNING | Boxed Warning Section |
Each input field in the Advanced Search page consists of two drop-down menus and a text field. The drop-down menus allow you to select a Boolean operator and search field to limit the current criteria. While you type, your current search query will appear on the bottom of the screen, so you may preview your search query before you submit it. Additionally, you can add new restrictions to your query by clicking the Add Criteria button, or remove one by clicking the Remove Criteria button. Finally, you can limit your search to only Human Drugs or Animal Drugs by clicking one of the radio buttons at the bottom of the screen.
Tips:
- You can search for an exact phrase by putting quotation marks (" ") around your query or part of your query.
- You can also use an asterisk (*) as a wildcard.
- You can use nested operators inside of a single criteria to limit your search even further.
Example Query | Description |
---|---|
NAME:(acetaminophen aspirin) | Find all drugs containing the words acetaminophen and aspirin in the name. |
NAME:("acetaminophen aspirin") | Find all drugs containing the exact phrase "acetaminophen aspirin" in the name. |
NAME:(acet*) | Find all drugs containing a word starting with acet- in the name. |
NAME:(acetaminophen NOT aspirin) | Find all drugs containing acetaminophen but not aspirin in the name. |
NAME:(tetracycline) NOT INGREDIENT:("benzyl alcohol") | Find all drugs containing tetracycline in the name but not containing "benzyl alcohol" as an ingredient |
Permanent URLs
SPL IDs are not static, so a label's URL may change if the label is updated. However, we provide permanent URLs to view or download the latest version of an SPL if you know the setId of the SPL you wish to view. If you do not know the setId, you can find out this information by using one of the web services listed above.
- http://dailymed.nlm.nih.gov/dailymed/lookup.cfm?setid={setId} is a permanent URL to view a label.
- http://dailymed.nlm.nih.gov/dailymed/downloadzipfile.cfm?setId={setid} is a permanent URL to download a label as a ZIP file. Additionally, the response header will indicate several pieces of useful information:
- Status Code
- 200 ACTIVE - the label is currently active.
- 200 ARCHIVED - the label has been archived.
- Content-Disposition: attachment;filename - shows the filename of the ZIP file.
- X-DAILYMED-LABEL-LAST-UPDATED - shows when the label was last updated.
- http://dailymed.nlm.nih.gov/dailymed/downloadpdffile.cfm?setId={setid} is a permanent URL to download a label as a PDF file. Additionally, the response header will indicate several pieces of useful information:
- Status Code
- 200 ACTIVE - the label is currently active.
- 200 ARCHIVED - the label has been archived.
- Content-Disposition: attachment;filename - shows the filename of the PDF file.
- X-DAILYMED-LABEL-LAST-UPDATED - shows when the label was last updated.