openFDA API
FDA · Health
FDA open data API providing access to drug labels, adverse events (FAERS), drug recalls, medical device reports, food enforcement, and tobacco product registrations. Essential for pharmacovigilance, drug safety research, and NDC lookups.
Authentication
Sample Requests
Search FDA drug labels by active ingredient
Hover any highlighted part to learn what it does
curl -X GET "https://api.fda.gov?limit=5&search=active_ingredient%3Ametformin"
import requests
params = {
"limit": "5",
"search": "active_ingredient:metformin"
}
response = requests.get(
"https://api.fda.gov",
params=params,
)
print(response.json())const url = new URL('https://api.fda.gov');
url.searchParams.set('limit', '5');
url.searchParams.set('search', 'active_ingredient:metformin');
const response = await fetch(url);
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://api.fda.gov")
q := baseURL.Query()
q.Set("limit", "5")
q.Set("search", "active_ingredient:metformin")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.fda.gov")
uri.query = URI.encode_www_form({
"limit" => "5",
"search" => "active_ingredient:metformin"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.fda.gov?" . http_build_query([
"limit" => "5",
"search" => "active_ingredient:metformin"
]);
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Postman Setup Guide
- No key needed for basic use (40 req/min); register free at https://open.fda.gov/apis/authentication/ for 240/min
- Drug labels: GET https://api.fda.gov/drug/label.json?search=active_ingredient:metformin
- Adverse events: GET https://api.fda.gov/drug/event.json?search=patient.drug.medicinalproduct:aspirin
- Drug recalls: GET https://api.fda.gov/drug/enforcement.json?search=status:Ongoing
- Add &api_key={your_key} to any query for higher limits
What can you build with openFDA API?
openFDA API is a Health API. Developers commonly use health APIs for:
- accessing medical reference data and drug information
- building patient-facing health tracking apps
- integrating with EHR and telemedicine platforms
- looking up ICD codes and clinical terminology
- powering wellness and fitness applications
API Key authentication. You'll receive a key after signing up. Send it with every request — in a header or query parameter. Keep it out of client-side code and never commit it to version control. openFDA API is free to use, making it a low-risk choice to experiment with.
New to APIs? Read our beginner's guide · Learn about API keys · What is REST?