0

I am using the openFDA NDC API. Searching and counting using the "manufacture_name.exact" field results in a status 400 bad request when passing the character "&" as part of the manufacturer name.

I am using the fetch API and JavaScript. The code is provided below; where "${manufacturer}" may be exactly: "The Procter & Gamble Manufacturing Company"

const manufacturerResponse = await fetch(`${this.ndcBaseEndpoint}?${this.apiKey}&search=openfda.manufacturer_name.exact:${manufacturer}&limit=10`)

I have reviewed this question where an answer by Nag lists the supported characters and & is not on that list.

I have tried using %26 as a replacement without success.

Is there a method to search with & inside the manufacturer name? If not, is there a reliable way to access the data which has "&" in the manufacturer's name?

1 Answer 1

1

This is now fixed:

https://api.fda.gov/drug/label.json?search=openfda.manufacturer_name.exact:%22The%20Procter%20%26%20Gamble%20Manufacturing%20Company%22

Sorry about the inconvenience.

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.