Skip to main content
Glama
jlucasmcrell

Apify Public Data & Leads

openFDA Drug and Device Search

openfda_search
Read-only

Search official openFDA datasets to find drug labels, approvals, adverse events, and recalls. Get normalized flat records for safety surveillance and regulatory tracking.

Instructions

Search official openFDA datasets for drug labels, drug approvals (Drugs@FDA), adverse events (FAERS), and drug, device, or food recalls. Returns normalized, flat records through one consistent interface.

Behavioral Transparency:

  • Execution: Network call executed synchronously in the cloud via Apify Actor 'captainhandsome/openfda-search'.

  • Side Effects: Reads public sources and creates a billed Actor run and dataset on your Apify account.

  • Authentication: Requires APIFY_TOKEN environment variable.

  • Latency & Limits: Typical run duration is 10-30 seconds; timeout capped at 120 seconds.

Usage Guidelines:

  • When to use: Use for drug/device safety surveillance, regulatory approval history, adverse-event monitoring, or recall tracking.

  • When NOT to use: Do not use for clinical trial recruitment data (use 'clinical_trials_search'), environmental compliance, campaign finance, or corporate registry lookups.

  • Named alternatives: Use 'clinical_trials_search' for ClinicalTrials.gov study data, 'epa_facility_search' for environmental compliance, 'fec_campaign_finance_search' for political funding, or 'french_company_search' for the French corporate registry.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
searchYesopenFDA query. A plain word works (e.g. 'semaglutide'), or target a field, e.g. 'openfda.manufacturer_name:"Pfizer"'.
datasetNoWhich openFDA dataset to search. Defaults to 'drug_approval'.drug_approval
max_resultsNoMaximum number of records to retrieve. Defaults to 10.
include_detailsNoAlso look up each result's product NDC to add labeler, marketing category, and DEA schedule. Costs one extra request per 20 records. Defaults to false.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
runNo
errorNo
statusYes
resultsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed26 schema fields changedv1.1.0
    • addedInput schema / additionalProperties
      Added value: +false
    • addedOutput schema / properties / error
      Added value: +{
      +  "type": "object"
      +}
    • removedOutput schema / properties / results / description
      Removed value: -"Collection of openFDA records matching the search."
    • changedOutput schema / properties / results / items / properties / application_number / description
      Previous value: -"FDA application number (NDA, ANDA, or BLA) the product is marketed under."New value: +"FDA application number (NDA, ANDA or BLA) the product is marketed under."
    • addedOutput schema / properties / results / items / properties / application_number / title
      Added value: +"Application number"
    • changedOutput schema / properties / results / items / properties / application_number / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • addedOutput schema / properties / results / items / properties / brand_name / title
      Added value: +"Brand name"
    • changedOutput schema / properties / results / items / properties / brand_name / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / results / items / properties / dataset / description
      Previous value: -"Which openFDA dataset produced this row."New value: +"Selected openFDA dataset that produced this row."
    • addedOutput schema / properties / results / items / properties / dataset / title
      Added value: +"Dataset"
    • changedOutput schema / properties / results / items / properties / dataset / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • addedOutput schema / properties / results / items / properties / generic_name / title
      Added value: +"Generic name"
    • changedOutput schema / properties / results / items / properties / generic_name / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / results / items / properties / id / description
      Previous value: -"Primary identifier for the row (SPL id, application number, safety report id, or recall number)."New value: +"Primary identifier for the row: SPL id for labels, application number for approvals, safety report id for adverse events, recall number for recalls."
    • addedOutput schema / properties / results / items / properties / id / title
      Added value: +"Record ID"
    • changedOutput schema / properties / results / items / properties / id / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • addedOutput schema / properties / results / items / properties / manufacturer / title
      Added value: +"Manufacturer"
    • changedOutput schema / properties / results / items / properties / manufacturer / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • addedOutput schema / properties / results / items / properties / route / title
      Added value: +"Route"
    • changedOutput schema / properties / results / items / properties / route / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • addedOutput schema / properties / results / items / properties / substance / title
      Added value: +"Substance"
    • changedOutput schema / properties / results / items / properties / substance / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • removedOutput schema / properties / results / items / required
      Removed value: -[
      -  "dataset",
      -  "id"
      -]
    • addedOutput schema / properties / run
      Added value: +{
      +  "type": "object"
      +}
    • addedOutput schema / properties / status
      Added value: +{
      +  "enum": [
      +    "success",
      +    "empty_unverified",
      +    "partial",
      +    "error"
      +  ],
      +  "type": "string"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "results"
      -]New value: +[
      +  "results",
      +  "status"
      +]
  2. Addedv1.0.11

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description adds substantial behavioral context beyond the annotations: synchronous cloud execution via a named Apify Actor, a billed run/dataset side effect on the user's account (important nuance given readOnlyHint=true), the APIFY_TOKEN authentication requirement, and concrete latency bounds (10-30s typical, 120s cap). These details materially change call decisions and are not inferable from readOnlyHint/openWorldHint alone.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with a crisp two-sentence purpose statement, then organized into labeled sections (Behavioral Transparency, Usage Guidelines) with four and three tersely worded bullets respectively. Every sentence earns its place — the billing caveat, auth requirement, latency bounds, and alternative routing are all decision-relevant with zero filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 100% parameter schema coverage, a rich enum, an output schema covering return values, and annotations covering the safety profile, the description fills every remaining gap: execution model, side effects/billing, auth, latency, and sibling routing. Nothing an agent needs to invoke this tool correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3; the schema itself already documents the query syntax with a field-targeting example, the dataset enum, max_results bounds, and the include_details cost model. The description's dataset-domain list loosely maps to the dataset enum but adds no new parameter-level semantics beyond what the schema provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Search') plus a precise resource (official openFDA datasets) and enumerates the covered domains: drug labels, drug approvals, adverse events (FAERS), and drug/device/food recalls. It also distinguishes itself from siblings by naming what it is not (clinical trials, environmental, campaign finance, corporate registry), so an agent can tell it apart before opening an alternate schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

A dedicated Usage Guidelines section gives explicit when-to-use conditions (safety surveillance, approval history, adverse-event monitoring, recall tracking), explicit when-NOT-to-use exclusions, and named alternatives for each excluded domain (clinical_trials_search, epa_facility_search, fec_campaign_finance_search, french_company_search). This is textbook routing guidance; nothing is left to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.