I want to count the average number of ingredients in each drug produced by a specific manufacturer in each year.

The results I want should be like this:

year | drug_names | avg_number_of_ingredients

2018 | drugA,drugB | 21

Can someone please help.

What I have done so far? I have tried different queries here : https://open.fda.gov/apis/drug/label/example-api-queries/ but unfortunately, the maximum I can do is count some field following some conditions like the query below:


What I want is to group manufacturers and count their drugs per year.


  • @JanDoggen I have updated the question.
    – Obiii
    May 18, 2019 at 13:40


Your Answer

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

Browse other questions tagged or ask your own question.