Frequently Asked Questions
Note: Community members can edit this page.
How to set openFDA queries? |
Queries to the openFDA APIs are made up of search parameters.
Each parameter follows this syntax: field:term. Note that there is a colon : between the field to search, and the term to search for. Search parameters are combined with an AND criteria. Blank parameters are not used in the query. Keyword search terms will match any field. For phrase matches, use double quotation marks " " around the words. For example, "multiple+myeloma" Use + for a space character in a term, For example, "multiple+myeloma" Wildcard queries return data that contain terms matching a wildcard pattern. For example, brand_name:child* will match records where the field brand_name contains child*, case-insensitive so "Child", "Children", "Childrens" among others will match. To group several terms together, use parentheses ( ). For example, patient.drug.medicinalproduct:(cetirizine+OR+loratadine+OR+diphenhydramine). To join terms as in a boolean AND, use the term +AND+. For example, (patient.drug.medicinalproduct:(cetirizine+OR+loratadine+OR+diphenhydramine))+AND+serious:2 requires that any of the drug names match and that the field serious also match. |
How to define effective AI prompts for analysis? |
Specify objectives clearly for targeted insights.
Use natural language for intuitive interactions. Consider context for relevant prompts. Offer guidance within prompts for effective queries. Iterate prompts for continuous improvement. Use ChatGPT or Gemini to optimize prompt structure. |
How to search by range in date, numeric, or string fields? |
The openFDA API supports searching by range in date, numeric, or string fields.
Specify an inclusive range by using square brackets [min+TO+max]. These include the values in the range. For example, [1+TO+5] will match 1 through 5. Dates are simple to search by via range. For instance, [2004-01-01+TO+2005-01-01] will search for records between Jan 1, 2004 and Jan 1, 2005. |