Example tobacco problem reports 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 Tobacco Problem Report

This query searches for all records and asks for a single one.

  1. Search for all records and display one.

  2. limit to 1 record.

Example query

Problem reports by submission date

This query searches for all records in a certain date range.

See the header fields reference for more about date_submitted. Brackets [ ] are used to specify a range for date, number, or string fields.

  1. search for all records with date_submitted between Jan 01, 2018 and July 23, 2020.

Example query

Problem reports by tobacco product

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

  1. search the tobacco products selected by the reporter