How to use the Endpoint

Getting started with and learning how to use the Application Programming Interface is relatively straightforward. Here are some recommended steps:

Then, when you are ready, obtain an Application Programming Interface Key. While you don’t need an Application Programming Interface Key to try or use the Application Programming Interface, we recommend you get one if you are planning to use the Application Programming Interface on a regular basis. For more information on Application Programming Interface Keys, see the Authentication documentation.

Making a simple Application Programming Interface Call

You can call the Application Programming Interface from a web browser. Simply type a valid query in your browser’s address bar and press the Enter key.

In the example below, we are searching the records in the drug NDC Directory endpoint for matches with Class III in the classification field. We are requesting to see the first 5 records that match."

https://api.fda.gov/drug/ndc.json
base endpoint
?
?
dea_schedule:"CIV"
field:term
&
&
limit=5
limit

Some key pointers

  • An openFDA query always begins with the base endpoint, which in this case is: https://api.fda.gov/drug/ndc.json
  • Searches have a special syntax: search=field:term
  • Unless otherwise specified, the Application Programming Interface will return only one matching record for a search. You can specify the number of records to be returned by using the limit parameter. The maximum limit allowed is 99 for any single Application Programming Interface call. If no limit is set, the Application Programming Interface will return one matching record.

It is possible to construct very complex queries using the openFDA Application Programming Interface. Review the Construct the query documentation to learn more about all the available query parameters, how to handle quotations, spaces, phrase matches, and groupings, how to search on dates and ranges, and more.