Example drug NDC queries

To help get you started, we have provided some query examples below. Use the Run query button to call the Application Programming Interface and get back results. You can experiment by editing the example queries in the black text box.

Example query

One product

This query searches for all finished products, and asks for a single one.

See the searchable fields for more about finished.

  1. Search for all products which have finished set to true.

  2. Limit to 1 record.

Example query

One lotion product

This query searches all lotion products, and returns a single product.

Double quotation marks " " surround phrases that must match exactly.

  1. Search for all products which have dosage_form equal to 'LOTION'.

  2. Limit to 1 record.

Example query

Count of pharm classes

This query searches the endpoint for all products, and tells the Application Programming Interface to count how many included each pharm_class.

The suffix .exact is required by openFDA to count the unique full phrases in the field voluntary_mandated. Without it, the Application Programming Interface will count each word in that field individually.

  1. Count the field pharm_class.