openFDA API

⭐ Beginner's Pick Health / API Key Intermediate HTTPS
Varies by plan (check documentation)

Overview

openFDA provides free public access to FDA datasets covering drug adverse events, product recalls, medical device reports, and food safety alerts. You can query millions of records using a flexible API without authentication for basic use, though an API key raises your rate limit. It is an excellent starting point for pharmaceutical research tools and safety monitoring apps.

💡

Beginner Tip

Use the search parameter with field:value syntax (e.g., patient.drug.medicinalproduct:"aspirin") and always include a limit to avoid downloading millions of records at once.

Available Data

recipe name and ingredients
nutritional values
calorie count
serving size
preparation time

Example Response

JSON Response
{
  "recipe": "Chicken Stir Fry",
  "calories": 380,
  "protein_g": 32,
  "carbs_g": 28,
  "fat_g": 14,
  "ingredients": [
    "chicken breast",
    "bell pepper",
    "soy sauce",
    "garlic"
  ],
  "prep_time_minutes": 20
}

Field Reference

meta Metadata including disclaimer, license, last updated date, and result counts.
results Array of matching records (drug events, recalls, or device reports depending on endpoint).
total Total number of records matching the search query across all pages.
skip Number of records skipped for pagination.
limit Maximum number of records returned in this response.
safetyreportid Unique identifier for a drug adverse event safety report.

Implementation Example

const url = "https://open.fda.gov/";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "X-API-Key": "YOUR_API_KEY"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

429 Too Many Requests Without an API key you are limited to 40 requests per minute
Register for a free API key at open.fda.gov/apis/authentication to increase limits to 240 requests/minute.
400 Bad Request - invalid query syntax The search query uses incorrect Lucene syntax
Use the format field:"value" and escape special characters; refer to the openFDA query syntax guide.
No hits returned The exact field name or spelling does not match the FDA schema
Use the openFDA interactive explorer to browse field names before writing code.

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 5/20
🔒 Security 15/15
🛠 Developer XP 12/20
✓ Reliability 10/15

Partially tested on Apr 5, 2026

Technical Specifications

Auth API Key
HTTPS REQUIRED
CORS UNKNOWN
Category Health
Difficulty Intermediate
Verified: 2026-04-04

Similar APIs

View All →