DailyMed: Drug Search¶
Queries the National Library of Medicine’s DailyMed API to retrieve structured drug information. Supports searches by drug name, NDC, SPL set ID, and active ingredient, returning both raw JSON and a human-readable summary. Useful for quickly exploring labels, ingredients, dosage forms, routes, and manufacturer details.

Usage¶
Use this node when you need authoritative drug label and product details from DailyMed. Choose a search_type (e.g., drug_name for general lookup, ndc for a specific product, set_id for a known SPL document, or ingredient to find products containing an active ingredient), provide a query, and set a result limit. Connect its outputs downstream to parsers, viewers, or decision logic that rely on either the raw JSON data or the formatted summary.
Inputs¶
| Field | Required | Type | Description | Example | 
|---|---|---|---|---|
| search_type | True | STRING (enum) | Determines the search mode: ndc, drug_name, set_id, or ingredient. | drug_name | 
| query | True | STRING | The search text corresponding to the chosen search_type. For ndc, hyphens/spaces are accepted and will be normalized. | aspirin | 
| limit | True | INT | Maximum number of results to return for list searches (min 1, max 100). Not applicable to set_id (single-item). | 10 | 
| exact_match | False | BOOLEAN | If true, requests exact matching for drug_name and ingredient searches. | False | 
| include_inactive | False | BOOLEAN | Intended to include inactive products. Current implementation does not apply this filter to the API call. | False | 
Outputs¶
| Field | Type | Description | Example | 
|---|---|---|---|
| results_json | STRING | Raw JSON string of the DailyMed API response (array for list searches, single object for set_id). | [{ "title": "Aspirin 325 mg", "setid": "...", "openfda": {"brand_name": ["Aspirin"]}}] | 
| formatted_results | STRING | Human-readable summary of the results, including title, set ID, brand/generic names, manufacturer, active ingredients, NDCs, dosage form, and route. | DailyMed Search Results (Drug Name)\n==================================================\n1. Title: Aspirin 325 mg\n Set ID: ...\n Brand Name: Bayer\n Generic Name: Aspirin\n Manufacturer: Bayer HealthCare LLC\n Active Ingredients: ASPIRIN\n NDC Codes: 12345-6789-01... | 
| result_count | INT | Number of returned results (0 when no matches or on error). | 3 | 
Important Notes¶
- The node queries public DailyMed endpoints with a 30-second timeout per request.
- For search_type=ndc, hyphens/spaces are removed before querying.
- For search_type=set_id, only a single SPL document is returned; limit does not apply.
- The exact_match flag is passed to the API for drug_name and ingredient searches as an exact=true parameter.
- The include_inactive input is currently not applied to the API request and has no effect in this version.
- Result structures may vary by product; some fields (e.g., openfda, dosage_form, route, strength) may be absent.
- Large limits (near 100) can increase latency; consider smaller limits for interactive use.
Troubleshooting¶
- No results found: Verify search_type and query spelling; try disabling exact_match or increasing limit.
- HTTP or timeout errors: Check network connectivity and try again; the API may be temporarily unavailable.
- Unexpected empty or missing fields: Different products expose different metadata; handle optional fields in downstream logic.
- Invalid search_type error: Ensure search_type is one of ndc, drug_name, set_id, or ingredient.
- NDC not matching: Try different NDC formats; the node normalizes hyphens/spaces but the code must exist in DailyMed.