I'm rying to eventually populate a spreadsheet with only the dosage_and_administration section for like 2000 medications. I created a query for this:

https://api.fda.gov/drug/label.json?search=openfda.substance_name:acetaminophen+AND+exists:dosage_and_administration

However all the other headings show up every time and I can't focus the query on just dosage_and_administration section. Is this possible?

  • pinging @openfdateam opendata.stackexchange.com/users/19731/openfda-team – philshem Jul 15 at 11:09
  • 1
    As a picky detail, the data is in JSON format, which is more associated with JavaScript than Java. I'm guessing you need this info for many drugs and don't want to download unnecessary data? Otherwise, it seems fairly easy to programmatically clip out the section you need (even without knowing JavaScript) – Barry Carter Jul 15 at 15:08
  • I used to program a bit in the passed, but unfortunately haven't kept up with it. If I could make it in a query format like the URL I gave above, it would fit nicely with excels query feature and I could populate my table as needed. I wouldn't even know where to start with making a javascript to only keep the section I need, and then have it export to excel. As it stands now I would have to do all this manually (which I'm really trying to avoid haha). I can definitely download the data if need be, its more just me not knowing what to do with it once its downloaded. – 4ntibody Jul 15 at 16:36

Unfortunately, we don't have a way to return only selected portions of JSON. Shouldn't be a problem though as long as you are processing the results programmatically -- just ignore the sections that are not relevant.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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