0

Is it possible to search OpenFDA using multiple search fields. Separately both terms work but I can't figure out how to search using both at the same time.

This is what I tried that does not work to search using rxcui and manufacturer_name.

$ curl https://api.fda.gov/drug/ndc.json\?search\=openfda.rxcui:860975\&search\=openfda.manufacturer_name\=NCS                                                                                  2.6.5

{
  "error": {
    "code": "BAD_REQUEST",
    "message": "Invalid parameter: openfda.rxcui:860975"
  }
}%

The rxcui by itself works

$ curl https://api.fda.gov/drug/ndc.json\?search\=openfda.rxcui:860975                                                                                                                          2.6.5

{
  "meta": {
    "disclaimer": "Do not rely on openFDA to make decisions regarding medical care. While we make every effort to ensure that data is accurate, you should assume all results are unvalidated. We may limit or otherwise restrict your access to the API in line with our Terms of Service.",
    "terms": "https://open.fda.gov/terms/",
    "license": "https://open.fda.gov/license/",
    "last_updated": "2020-05-30",
    "results": {
      "skip": 0,
      "limit": 1,
      "total": 92
    }
  },
  "results": [
    ...
  ]
}

The manufacturer_name by itself works

$ curl https://api.fda.gov/drug/ndc.json\?search\=openfda.manufacturer_name\=NCS                                                                                                                2.6.5

{
  "meta": {
    "disclaimer": "Do not rely on openFDA to make decisions regarding medical care. While we make every effort to ensure that data is accurate, you should assume all results are unvalidated. We may limit or otherwise restrict your access to the API in line with our Terms of Service.",
    "terms": "https://open.fda.gov/terms/",
    "license": "https://open.fda.gov/license/",
    "last_updated": "2020-05-30",
    "results": {
      "skip": 0,
      "limit": 1,
      "total": 318
    }
  },
  "results": [
    ...
  ]
}
0

Yes, you can use AND logical operator as described in the openFDA documentation.

| improve this answer | |

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.