/** * FDA SDK — typed API client for the openFDA APIs. * * Standalone — no MCP server required. Usage: * * import { searchDrugEvents, searchFoodRecalls, countDrugEvents } from "us-gov-open-data-mcp/sdk/fda"; * * const events = await searchDrugEvents({ search: "patient.drug.openfda.brand_name:aspirin", limit: 5 }); * console.log(events.meta.results.total, events.results); * * const topReactions = await countDrugEvents("patient.reaction.reactionmeddrapt.exact"); * console.log(topReactions.results); // [{term, count}, ...] * * const recalls = await searchFoodRecalls({ search: "classification:\"Class I\"", limit: 10 }); * console.log(recalls.results); * * No API key required (240 req/min without key, 120K req/day with key). * Optional DATA_GOV_API_KEY for higher limits — get one at https://api.data.gov/signup/ * Docs: https://open.fda.gov/apis/ */ export type { OpenFdaMeta, FdaResult, CountResult, OpenFdaDrugAnnotation, OpenFdaDeviceAnnotation, EnforcementRecall, DrugEvent, DrugLabel, DrugNdc, DrugShortage, ApprovedDrug, DeviceEvent, Device510k, DeviceClassification, DevicePma, DeviceUdi, DeviceRegistration, CovidSerology, FoodAdverseEvent, AnimalEvent, TobaccoProblem, HistoricalDocument, Nsde, SubstanceData, Unii, } from "./types.js"; import type { FdaResult, CountResult, DrugEvent, DrugLabel, DrugNdc, DrugShortage, ApprovedDrug, DeviceEvent, Device510k, DeviceClassification, DevicePma, DeviceUdi, DeviceRegistration, CovidSerology, EnforcementRecall, FoodAdverseEvent, AnimalEvent, TobaccoProblem, HistoricalDocument, Nsde, SubstanceData, Unii } from "./types.js"; export { FDA_ENDPOINTS, FDA_COUNT_FIELDS } from "./types.js"; /** Standard search options accepted by all OpenFDA endpoints. */ interface SearchOpts { search?: string; limit?: number; skip?: number; } /** * Search adverse drug events (FAERS). 20M+ reports. * * Example: * await searchDrugEvents({ search: "patient.drug.openfda.brand_name:aspirin", limit: 5 }); * await searchDrugEvents({ search: "serious:1 AND patient.patientsex:2", limit: 10 }); */ export declare function searchDrugEvents(opts?: SearchOpts): Promise>; /** * Search drug labels (package inserts / prescribing information — SPL). * Each result contains standard SPL fields, product-specific sections * (indications, warnings, boxed_warning, adverse_reactions, etc.), * and an openfda annotation with harmonized identifiers. * * Example: * await searchDrugLabels({ search: 'openfda.brand_name:"Tylenol"', limit: 3 }); * await searchDrugLabels({ search: '_exists_:boxed_warning', limit: 5 }); */ export declare function searchDrugLabels(opts?: SearchOpts): Promise>; /** * Search the NDC Directory — National Drug Code product listings. 132K+ records. * Each entry has product data, packaging info, active ingredients, and openfda annotations. * * Example: * await searchDrugNdc({ search: 'brand_name:"Tylenol"', limit: 5 }); * await searchDrugNdc({ search: 'dea_schedule:"CII"', limit: 10 }); * await searchDrugNdc({ search: 'dosage_form:"LOTION"', limit: 1 }); */ export declare function searchDrugNdc(opts?: SearchOpts): Promise>; /** * Search drug recall enforcement reports. * * Example: * await searchDrugRecalls({ search: 'classification:"Class I"', limit: 10 }); * await searchDrugRecalls({ search: 'recalling_firm:"Pfizer"' }); */ export declare function searchDrugRecalls(opts?: SearchOpts): Promise>; /** * Search FDA-approved drugs (Drugs@FDA database). * Contains approval history, labeling, and active ingredients. * * Example: * await searchApprovedDrugs({ search: 'openfda.brand_name:"Ozempic"' }); * await searchApprovedDrugs({ search: 'sponsor_name:"Pfizer"', limit: 10 }); */ export declare function searchApprovedDrugs(opts?: SearchOpts): Promise>; /** * Search drug shortages. 1.7K records — tracks which drugs are in shortage and why. * * Example: * await searchDrugShortages({ search: 'status:"Currently in Shortage"', limit: 10 }); * await searchDrugShortages({ search: 'dosage_form:"Capsule"', limit: 5 }); * await searchDrugShortages({ search: 'therapeutic_category:"Antiviral"' }); */ export declare function searchDrugShortages(opts?: SearchOpts): Promise>; /** * Search medical device adverse event reports (MAUDE). * * Example: * await searchDeviceEvents({ search: "device.generic_name:pacemaker", limit: 10 }); */ export declare function searchDeviceEvents(opts?: SearchOpts): Promise>; /** * Search 510(k) premarket clearances. 174K+ records since 1976. * Each result includes device name, applicant, decision, clearance type, and advisory committee. * * Example: * await searchDevice510k({ search: 'advisory_committee:cv', limit: 5 }); * await searchDevice510k({ search: 'openfda.regulation_number:868.5895' }); * await searchDevice510k({ search: 'device_name:"pacemaker"', limit: 10 }); */ export declare function searchDevice510k(opts?: SearchOpts): Promise>; /** * Search medical device classification. ~1,700 generic device types. * Returns device class (I/II/III), product codes, regulation numbers, and definitions. * * Example: * await searchDeviceClassification({ search: 'regulation_number:872.6855' }); * await searchDeviceClassification({ search: 'product_code:NOB' }); */ export declare function searchDeviceClassification(opts?: SearchOpts): Promise>; /** * Search device recall enforcement reports. * Same schema as drug/food enforcement. Records before June 2012 may lack some fields. * * Example: * await searchDeviceEnforcement({ search: 'classification:"Class III"' }); * await searchDeviceEnforcement({ search: 'report_date:[20040101+TO+20131231]' }); */ export declare function searchDeviceEnforcement(opts?: SearchOpts): Promise>; /** * Search medical device recall reports (RES system). * * Example: * await searchDeviceRecalls({ search: 'openfda.device_name:"pacemaker"', limit: 10 }); */ export declare function searchDeviceRecalls(opts?: SearchOpts): Promise>>; /** * Search Premarket Approval (PMA) decisions for Class III devices. * * Example: * await searchDevicePma({ search: 'decision_code:APPR', limit: 5 }); * await searchDevicePma({ search: 'product_code:LWP' }); */ export declare function searchDevicePma(opts?: SearchOpts): Promise>; /** * Search device registration & listing. 336K+ establishment records. * * Example: * await searchDeviceRegistrations({ search: 'products.product_code:HQY' }); * await searchDeviceRegistrations({ search: 'products.openfda.regulation_number:886.5850' }); */ export declare function searchDeviceRegistrations(opts?: SearchOpts): Promise>; /** * Search Unique Device Identifiers (GUDID). * Detailed device records including description, MRI safety, product codes, sterilization. * Note: Booleans stored as strings ("true"/"false"). * * Example: * await searchDeviceUdi({ search: 'brand_name:"CoRoent"' }); * await searchDeviceUdi({ search: 'is_rx:true', limit: 5 }); */ export declare function searchDeviceUdi(opts?: SearchOpts): Promise>; /** * Search COVID-19 serology test evaluations. * * Example: * await searchCovidSerology({ search: 'antibody_truth:"Positive"' }); * await searchCovidSerology({ search: 'manufacturer:"Abbott"' }); */ export declare function searchCovidSerology(opts?: SearchOpts): Promise>; /** * Search food recall enforcement reports. * * Example: * await searchFoodRecalls({ search: 'classification:"Class I"', limit: 10 }); */ export declare function searchFoodRecalls(opts?: SearchOpts): Promise>; /** * Search food adverse event reports (CAERS — FDA's food safety surveillance). * * Example: * await searchFoodAdverseEvents({ search: 'products.industry_name:"Dietary Supplements"' }); */ export declare function searchFoodAdverseEvents(opts?: SearchOpts): Promise>; /** * Search animal/veterinary adverse events. 1.3M+ reports. * Each record has: header, animal info (species, breed), drugs, reactions (VEDDRA terms), outcomes. * Some fields may contain 'MSK' (masked) values for privacy. * * Example: * await searchAnimalEvents({ search: 'original_receive_date:[20040101+TO+20161107]', limit: 5 }); * await searchAnimalEvents({ search: 'animal.species:"Dog"', limit: 10 }); */ export declare function searchAnimalEvents(opts?: SearchOpts): Promise>; /** * Search tobacco problem reports. ~1.3K records. * Reports about tobacco products that are damaged, defective, or cause health effects. * E-cigarettes/vaping products dominate (~60% of reports). * * Example: * await searchTobaccoProblems({ search: 'date_submitted:[20180101+TO+20200723]' }); */ export declare function searchTobaccoProblems(opts?: SearchOpts): Promise>; /** * Search historical FDA documents (press releases, 1913–2014). Full-text OCR search. * * Example: * await searchHistoricalDocs({ search: 'doc_type:pr AND text:"poison prevention"', limit: 5 }); * await searchHistoricalDocs({ search: 'year:1920 AND text:Botulism' }); */ export declare function searchHistoricalDocs(opts?: SearchOpts): Promise>; /** * Search NDC SPL Data Elements (NSDE). * Use `_missing_:marketing_end_date` for products still on market, * `_exists_:marketing_end_date` for discontinued. * * Example: * await searchNsde({ search: 'package_ndc:"55700-019-60"' }); * await searchNsde({ search: '_missing_:"marketing_end_date"', limit: 10 }); */ export declare function searchNsde(opts?: SearchOpts): Promise>; /** * Search FDA substance data (molecular-level). Search by name, CAS code, UNII, or formula. * * Example: * await searchSubstances({ search: 'names.name:"PARACETAMOL"' }); * await searchSubstances({ search: 'codes.code:"220127-57-1"' }); * await searchSubstances({ search: 'structure.formula:"C6H12"' }); */ export declare function searchSubstances(opts?: SearchOpts): Promise>; /** * Search UNII (Unique Ingredient Identifiers). * * Example: * await searchUnii({ search: 'unii:"L7V4I673D2"' }); * await searchUnii({ search: 'substance_name:"ASPIRIN"' }); */ export declare function searchUnii(opts?: SearchOpts): Promise>; /** * Count/aggregate drug adverse events by a specific field (legacy — kept for backward compat). * * Example: * await countDrugEvents("patient.reaction.reactionmeddrapt.exact"); */ export declare function countDrugEvents(field: string, opts?: { search?: string; limit?: number; }): Promise; /** * Count/aggregate any OpenFDA endpoint by a specific field. * Returns top terms with counts. Use `.exact` suffix for full phrase counts. * * Example: * await countEndpoint("drug/ndc", "pharm_class.exact"); * await countEndpoint("device/510k", "country_code"); * await countEndpoint("tobacco/problem", "tobacco_products.exact"); * await countEndpoint("drug/event", "patient.reaction.reactionmeddrapt.exact", { search: "serious:1" }); */ export declare function countEndpoint(endpoint: string, field: string, opts?: { search?: string; limit?: number; }): Promise; /** Clear cached responses. */ export declare function clearCache(): void; //# sourceMappingURL=sdk.d.ts.map