You are here


Printer-friendly versionPrinter-friendly version

The RxIMAGE API is a freely accessible Application Programming Interface that software developers can use to create apps for text-based search and retrieval from the RxIMAGE database. The RxIMAGE database is the Nation’s only portfolio of curated, freely available, increasingly comprehensive, high-quality digital images of prescription pills and associated data. The general public can use such apps to search for and retrieve images and data from the RxIMAGE database.

Photographs of pills in the RxIMAGE database were taken under laboratory lighting conditions, from a camera directly above the front and the back faces of the pill, at high resolution, and using specialized digital macro-photography techniques. Image segmentation algorithms were then applied to create the JPEG images in the database. The images include NLM watermarks.

The RxIMAGE database contains images of thousands of pills. The images and data are intended for use in health care and research applications, in environments ranging from smart phones to desktops. Examples of pills are capsules and tablets intended for oral use.


The RxIMAGE API is a RESTful (representational state transfer) Web API. Results can be returned in either JSON (JavaScript Object Notation) or XML format. API conventions are:

  • Parameter names use the camelCase naming convention.
  • Parameters are presented in escaped format.
  • Logical AND is used to parse multiple parameters and multiple terms within one parameter.

The API request has the form:{apiName}/{apiVersion}/{resourcePath}?{parameters} where:

  • {apiName}=rximage
  • {apiVersion}=1
  • {resourcePath}=rxnav (image includes an information panel that gives name, dosage, manufacturer, color(s), imprint (text on the pill), shape, and size) or rxbase (no panel)
  • GET parameters for image selection by appearance are color(s), imprint, imprintColor(s), imprintType (debossed, embossed, or printed), score, shape, size, sizeT (T for tolerance), and symbol (presence/absence)
  • GET parameters for image selection by codes and names enable, for example, search for a specific National Drug Code (NDC), Structured Product Labeling (SPL) identifier, brand name, generic name, active ingredient, or inactive ingredient
  • GET parameters for results control can:
    • Request that the output data include lists of active and/or inactive ingredients or include color(s), imprint, imprintColor(s), imprintType, score, shape, size, and symbol
    • Specify image resolution – one is recommended for high-bandwidth and print, several are for mobile devices
    • Request a specific number of images and their associated data or request paged output

For each image found in response to an API request, the API returns the URL of the image, the brand name and dosage, NDC data, and SPL identifier; appearance parameter values are optional.

API developers are encouraged to use the enumeration parameter to retrieve possible values for the color, imprintColor, imprintType, resolution, score, shape, and size parameters.


Software developers can fill out a form to select or enter desired API parameter values, see the resultant API request as each value is selected or entered or changed, and then submit the request or view the images returned by the request.


Detailed RxIMAGE API Documentation provides information about RxIMAGE parameters and examples.


The API request for all blue pills that are exactly 17 mm (millimeters) in their longest dimension is:

An API request for all blue pills that are exactly 17 mm (millimeters) in their longest dimension returns these images.


Suggested attribution: RxIMAGE is a product of the National Library of Medicine.


Please send comments and questions about the RxIMAGE API and the RxIMAGE database to


The pills photographed for the database have been voluntarily provided by pharmaceutical manufacturers, purchased from licensed pharmaceutical retailers, acquired through wholesale channels, or provided by other Federal agencies.

The RxIMAGE API and database are part of the Computational Photography Project for Pill Identification. C3PI is a research and development project in NLM/LHNCBC.

The Center for Drug Evaluation and Research at the U.S. Food and Drug Administration provided technical advice, funding, and in-kind support for the development of the SPL image guidelines, the establishment of an imaging facility, and some image capture.