I'm trying to query for all drugs related to a certain disease group (say, for example testicular cancer). How would I structure that query? is this possible?
I'm Jack Finch with the openFDA team. Looking at what you're trying to do, I'll suggest a couple queries that should satisfy your needs and link you to the appropriate sections of documentation which explains how it works.
If you just want a list of drugs which are related to a specific disease (or any other text string, for that matter), you can search for that string and get the count of substance_name.
If you'd prefer to have all of the details for the drugs, you can use the limit field to specify how many results you want maximum (the default is 1). If you search just for testicular cancer (
https://api.fda.gov/drug/label.json?search="testicular cancer"), the meta field will include a total field, indicating how many records were found by your search (40 in this case). You can then set the limit to an appropriate amount. Note that while displaying 40 records in the browser is feasible, any more than 100 may result in a delayed response or even a crashed browser - there are limits to the amount of data that we can easily display over the web.
The search with the limit qualifier set looks like this: