First time to use the OpenFDA API's. Very nice work!

It seems like wildcards are not permitted in queries, so I was curious how one might go about generating data such as count of specific AEs by generic_name of the medication?

Thanks, MC


You cannot do a two-way table where you get a list of adverse events by drug using the current openFDA API.

What you can do is find most of* this information in a two step process which can of course be automated:

  1. Get a list of drugs by generic name: https://api.fda.gov/drug/event.json?search=&count=patient.drug.openfda.generic_name.exact&limit=1000
  2. Get a list of adverse events that have shown up in event reports that contained that generic drug. For example, ASPIRIN: https://api.fda.gov/drug/event.json?search=patient.drug.openfda.generic_name.exact:ASPIRIN&count=patient.reaction.reactionmeddrapt.exact&limit=1000

* "most of" because these count queries will return only the top 1000 results

Hope this helps!

| improve this answer | |

Another route if your looking for a quick way to research is search the generic name on researchae.com then look at the stats tab and graphs for more detailed counts. For example a search of the generic name for Coreg results the following:


Remember though there are different ways to search and you might want to add some additional filter to get to the data you are looking for.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.