Example drug labeling API queries

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

Example query

One adverse event report

This query searches for all records in a certain date range, and asks for a single one. See the header fields reference for more about receivedate. Brackets [ ] are used to specify a range for date, number, or string fields.

  1. search for all records with receivedate between Jan 01, 2004 and Dec 31, 2008. limit to 1 record.

  2. see searchable fieldsfor more about receivedate. Brackets [ ] are used to specify a range for date, number, or string fields.

Example query

One adverse event report with a drug from a certain pharmacologic class

This query searches records listing a drug of a certain pharmacologic class, and returns a single record. A record returned by this query may have multiple drugs listed. At least one of the drugs belongs to the pharmacologic class. See the openFDA fields reference for more about the kinds of searches they enable. Double quotation marks " " surround phrases that must match exactly. The plus sign + is used in place of a space character .

A record returned by this query may have multiple drugs listed. At least one of the drugs belongs to the pharmacologic class. See searchable fields for more about the kinds of searches they enable.

Double quotation marks " " surround phrases that must match exactly. The plus sign + is used in place of a space character.

  1. search for all records with receivedate between Jan 01, 2004 and Dec 31, 2008. limit to 1 record.

  2. see searchable fields for more about receivedate. Brackets [ ] are used to specify a range for date, number, or string fields.

Example query

Count of patient reactions

This query is similar to the prior one, but returns a count of the 1000 most frequently reported patient reactions. Multiple drugs in the records may match this class, and the drugs from this class may not be those which caused the associated adverse patient reactions. The suffix .exact is required by openFDA to count the unique full phrases in the field patient.reaction.reactionmeddrapt. Without it, the API will count each word in that field individually—difficulty sleeping would be counted as separate values, difficulty and sleeping. See the patient reaction reference for more about patient reactions in adverse event records.

The suffix .exact is required by openFDA to count the unique full phrases in the field patient.reaction.reactionmeddrapt. Without it, the API will count each word in that field individually—difficulty sleeping would be counted as separate values, difficulty and sleeping.

  1. search for all records with receivedate between Jan 01, 2004 and Dec 31, 2008. limit to 1 record.

  2. see searchable fields for more about receivedate. Brackets [ ] are used to specify a range for date, number, or string fields.