I'm working on calculating a PRR, but instead of using a drug-adverse event pair, I'm looking at the drug-SOC (system organ class) pair, which needs all the reports of every drug-ADE pair within a specific SOC.

So to do this, I wanted to know if there was a query that could get all the counts for a specific ADE; right now I'm running: https://api.fda.gov/drug/event.json?search=patient.reaction.reactionmeddrapt=fatigue&count=patient.drug.medicinalproduct.exact&limit=1000, using fatigue as an example ADE.

The reason I'm looking for more results is because I want to implement all the counts greater than 10; which is not possible here since the lowest count for the query is 125. Does anyone know a workaround?

I also tried using openFDA's range function, for example: https://api.fda.gov/drug/event.json?search=receivedate:[20040101+TO+20160601]+AND+[10+TO+10000000], but I don't know if this is what I actually want. How would I specify that the range is for the count of each drug-ADE pair?


1 Answer 1


Unfortunately, you cannot filter on count= results with the current API.

You may consider using the downloads to create your pairs.

The downloads can be found at: https://api.fda.gov/download.json They will be updated on some interval. The downloads are the exact same as the API output.

Once you have the downloads, you can use a script similar to this one. I think it will be a little different, since you will have to loop over all the drugs on an event for each reaction. The script doesn't take too long to run (hour or so once the downloads are done) and is perfect for these types of scenarios where you just want to prepare data for something like R.

Best of luck.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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