MenMD.com: Pharmaceuticals, Diseases & Supplements Information

How to Use OpenFDA and FAERS APIs to Access Drug Side Effect Reports

share

OpenFDA Drug Side Effect Search Tool

Search FDA Drug Side Effects

Enter a drug name and side effect to see sample results from the FDA's FAERS database. Remember: these are reported side effects, not confirmed risks.

Search Results

Example API Query
https://api.fda.gov/drug/event.json?api_key=YOUR_KEY&search=drugname:"[DRUG]"+AND+patient.reaction.reactionmeddrapt:"[REACTION]"
Sample Report Data

These are simulated results to demonstrate the format of OpenFDA data. Actual data may vary.

Drug Information
Generic: Metformin
Brand: Glucophage
Dosage: 500mg daily
Reaction Details
Reaction: Hepatitis
Onset: 14 days after start
Severity: Moderate
Patient Demographics
Age: 68
Gender: Female
Weight: 65kg
Outcome
Hospitalization: Yes
Recovery: Partial
Important Safety Note

A report indicates a side effect was reported, but it does not prove the drug caused it. Many reports are coincidental. This data is for research purposes only - do not make medical decisions based on these reports. Always consult your healthcare provider.

Every year, over 14 million reports of drug side effects flood into the FDA’s FAERS database. But until 2014, getting access to this data meant downloading massive XML files, wrestling with outdated tools, and waiting weeks just to find one drug’s safety signal. Today, you can pull the same information in seconds using the OpenFDA API-no special clearance, no paperwork, just a free API key and a few lines of code.

What Is OpenFDA, and How Does It Relate to FAERS?

OpenFDA is the U.S. Food and Drug Administration’s public-facing API system. It doesn’t collect new data-it opens up existing government datasets that were buried in hard-to-use formats. The most widely used of these is the FDA Adverse Event Reporting System, or FAERS. FAERS is the official database where doctors, patients, and drug companies report side effects from medications, vaccines, and medical devices. These reports include details like the drug name, patient age, symptoms, and outcomes-like hospitalization or death.

Before OpenFDA, researchers had to manually download FAERS data in XML or CSV format, then clean and structure it themselves. That process could take days. OpenFDA changed that. It turned FAERS into a searchable, real-time API. Now you can ask questions like, “Show me all reports of liver damage linked to metformin in people over 65,” and get structured JSON results back in under a second.

How to Get Started with the OpenFDA API

You don’t need to be a developer to use OpenFDA-but you do need an API key. Go to open.fda.gov/apis/authentication/ and sign up. You’ll get a key that lets you make 120,000 requests per day. Without a key, you’re capped at 1,000 requests per day, which isn’t enough for serious analysis.

Once you have your key, you’re ready to query. The main endpoint for drug side effects is /drug/event. Every request must follow this format:

https://api.fda.gov/drug/event.json?api_key=YOUR_KEY&search=drugname:"metformin"+AND+patient.reaction.reactionmeddrapt:"hepatitis"
That’s Elasticsearch syntax. It’s not user-friendly at first, but it’s powerful. You can search by:

  • Drug name (generic or brand)
  • Reaction term (using MedDRA standardized codes)
  • Patient age, gender, or weight
  • Outcome (death, hospitalization, life-threatening)
  • Date range
You can also limit results to 100 per call (the max) and use the skip parameter to page through thousands of reports. For example, to get the second page of 100 results, add &skip=100.

What Data Can You Actually Get?

Each report returned by OpenFDA includes a structured JSON object. Here’s what’s in there:

  • Drug information: Generic name, brand name, dosage, route of administration
  • Reaction details: MedDRA-coded adverse event term (e.g., “hepatitis,” “anaphylaxis”), onset date, severity
  • Patient demographics: Age, gender, weight (if reported), location (country only, no addresses)
  • Outcome: Recovery status, hospitalization, disability, death
  • Reporter type: Doctor, pharmacist, consumer, or manufacturer
Important: No personal identifiers are included. You won’t see names, addresses, or medical record numbers. That’s by design-the FDA protects privacy while still letting researchers spot patterns.

Common Mistakes and How to Avoid Them

Most people who try OpenFDA hit walls within the first hour. Here’s what goes wrong-and how to fix it.

Mistake 1: Using brand names instead of generic names. Searching for “Lipitor” won’t work well. Use “atorvastatin.” The data is indexed by generic names. If you’re unsure, cross-check with the FDA’s NDC Directory API.

Mistake 2: Ignoring rate limits. If you hit 100 requests per minute without a key, or 240 with one, you’ll get blocked. Always build in delays between calls. In Python, use time.sleep(0.5). In R, the openFDA package handles this automatically.

Mistake 3: Thinking reports = proof. A report says someone took a drug and then got sick. It doesn’t prove the drug caused it. Many side effects are coincidental. A 70-year-old on metformin who gets hepatitis might have hepatitis C, not a drug reaction. OpenFDA shows signals-not diagnoses.

Mistake 4: Skipping the disclaimer. The FDA is clear: “Do not rely on openFDA to make decisions regarding medical care.” This data is for research, not personal health choices. Always consult a doctor before changing medication.

A doctor gives a prescription while floating icons of side effects connect to an OpenFDA API logo.

Real-World Use Cases

OpenFDA isn’t just for academics. Here’s how it’s being used right now:

  • Academic research: Over 350 peer-reviewed studies in 2022 used OpenFDA to analyze drug safety trends. One study found a spike in pancreatitis reports with GLP-1 agonists like semaglutide-years before the FDA issued a warning.
  • Consumer tools: Apps like MedWatcher use OpenFDA to show users how often a drug’s side effects are reported compared to similar drugs.
  • Pharmaceutical companies: Small biotechs use it to benchmark their drug’s safety profile against competitors before launching clinical trials.
  • Public health monitoring: During the 2023 flu season, researchers used OpenFDA to track rare neurological side effects linked to certain vaccines.
One researcher in Australia used OpenFDA to compare side effect rates between two diabetes drugs. He found that while both caused nausea, one had 3x more reports of severe vomiting. He shared the findings with his clinic, and they adjusted prescribing patterns for elderly patients.

Limitations You Can’t Ignore

OpenFDA is powerful-but it’s not perfect.

  • Data lag: Reports take up to three months to appear in the API. The system needs time to process, de-identify, and validate submissions.
  • Underreporting: Only about 1% of all side effects get reported. Most patients don’t know how, or think it’s not worth it.
  • No clinical context: You won’t know if the patient had other illnesses, took other drugs, or had genetic risk factors.
  • No signal detection: OpenFDA gives you raw reports. It doesn’t tell you if a side effect is statistically unusual. That’s where tools like ARTEMIS or Oracle Argus come in-but those cost $150,000 a year. OpenFDA is free, but you have to do the math yourself.
If you’re looking for automated alerts or machine learning models that flag emerging risks, you’ll need to build your own. Or use open-source tools like PharmGKB or MedWatcher that already layer OpenFDA data with analysis.

Tools and Libraries to Make It Easier

You don’t have to write raw HTTP requests. Here are some helpers:

  • R package: openFDA on CRAN. Install with install.packages("openFDA"). Use set_api_key("your-key-here") and then search_drug("metformin").
  • Python: Use requests and pandas. Example: response = requests.get("https://api.fda.gov/drug/event.json?api_key=...&search=...&limit=100")
  • JavaScript: Fetch API works fine. Just handle rate limits and CORS.
  • Microsoft Power BI: You can connect directly via the OpenFDA connector. Great for dashboards.
The R package is the easiest for beginners. It handles pagination, rate limiting, and even converts MedDRA codes into readable terms.

A figure stands before a holographic chart of drug side effect spikes inside a glowing data cathedral.

What’s Next for OpenFDA?

The FDA is expanding OpenFDA beyond drugs. New endpoints now include:

  • Medical device adverse events
  • Food safety reports
  • Tobacco product complaints
In 2023, they improved the data pipeline to reduce the reporting lag from 90 to 60 days. They’re also working on better documentation and sample code. The GitHub repo is active, with updates as recent as September 2023.

The big vision? Make the FDA’s data as accessible as weather data. If you can check the forecast with a phone app, you should be able to check a drug’s safety profile just as easily.

Frequently Asked Questions

Is OpenFDA free to use?

Yes, OpenFDA is completely free. You don’t pay for API access, data downloads, or documentation. The only cost is your time to learn how to use it. This is different from commercial tools like Oracle Argus or ARTEMIS, which charge hundreds of thousands of dollars per year.

Can I use OpenFDA to check if my medication is safe?

No. OpenFDA shows reports of side effects, not proven risks. Many reports are coincidental. For example, if you take a drug and then get a headache, it doesn’t mean the drug caused it. Always talk to your doctor or pharmacist before making any changes to your medication. OpenFDA is for research, not personal medical decisions.

Why can’t I find reports for my drug?

There are a few reasons. First, the drug might be too new-reports take up to 90 days to appear. Second, you might be using the brand name. Try the generic name. Third, very few people may have reported side effects. Some drugs have low usage or mild side effects that go unreported. Try searching for similar drugs to compare.

Do I need programming skills to use OpenFDA?

Not necessarily. You can use tools like Microsoft Power BI or the R package openFDA without writing code. But to do deeper analysis-like comparing side effect rates across multiple drugs-you’ll need to understand basic queries and JSON. Start with the R package. It’s the easiest way in.

How often is the data updated?

The FDA updates the OpenFDA database quarterly. New data is added every three months, but it can take up to 90 days after a report is submitted for it to appear. This delay is due to the time needed to process, de-identify, and validate reports. So if you’re looking for the latest safety signals, you’re seeing data that’s up to three months old.

Next Steps

If you’re a researcher, start by installing the R package and running a simple search. Compare two common drugs-say, ibuprofen and acetaminophen-and see how their side effect profiles differ. If you’re a developer, try building a small dashboard that shows the top 10 side effects for a drug over time. If you’re a patient, use OpenFDA to understand what others have reported-but never make health decisions based on it alone.

The data is out there. The tools are free. The only thing missing is the curiosity to ask the right questions.

About author

Alistair Kingsworth

Alistair Kingsworth

Hello, I'm Alistair Kingsworth, an expert in pharmaceuticals with a passion for writing about medication and diseases. I have dedicated my career to researching and developing new drugs to help improve the quality of life for patients worldwide. I also enjoy educating others about the latest advancements in pharmaceuticals and providing insights into various diseases and their treatments. My goal is to help people understand the importance of medication and how it can positively impact their lives.