3

I'm in a process of investigation of openFDA API and its possibilities.

For now I'm reviewing this type of request - One enforcement report of a certain health hazard class

https://api.fda.gov/drug/enforcement.json?search=classification:"Class+I"

Is it possible to make a request which returns results for all Hazard classes?

When I tried to use such a query

https://api.fda.gov/drug/enforcement.json?search=classification:"Class+I"+classification:"Class+II"

system returns results only for the last term (in current case "Class II")

0

Here is the correct query syntax for an 'OR' search:

https://api.fda.gov/drug/enforcement.json?search=classification:("Class+I"+OR+"Class+II")

I took a look and the result count equals the count of Class 1 + Class 2 so this should be what you were looking for.

More information on openFDA "API Basics" are at https://open.fda.gov/api/reference/#query-syntax though there was not a specific example for an OR search that had spaces in it.

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.