DailyMed: Drug Search¶
Searches the U.S. DailyMed database for drug information and returns both raw JSON and a human-readable summary. Supports multiple search modes (by drug name, NDC, set_id, or active ingredient), optional exact matching, and the ability to include inactive products.

Usage¶
Use this node to retrieve label and product details when you need authoritative drug information (e.g., during clinical data enrichment, medication verification, or building reference lookups). Choose the search type, provide a query, and set a result limit. The node outputs a JSON string for programmatic use and a formatted text summary for quick inspection.
Inputs¶
| Field | Required | Type | Description | Example |
|---|---|---|---|---|
| search_type | True | STRING | Select the search mode. Allowed values: ndc, drug_name, set_id, ingredient. | drug_name |
| query | True | STRING | The search query string. Interpreted according to the selected search_type. | aspirin |
| limit | True | INT | Maximum number of results to return. Must be between 1 and 100. | 10 |
| exact_match | False | BOOLEAN | If true, restricts results to exact matches based on the search_type. | False |
| include_inactive | False | BOOLEAN | If true, includes inactive or discontinued products in search results. | False |
Outputs¶
| Field | Type | Description | Example |
|---|---|---|---|
| results_json | STRING | Raw DailyMed search results as a JSON-formatted string for programmatic parsing and downstream processing. | {"results": [{"brand_name": "Aspirin", "ndc": "0000-0000-00"}], "count": 1} |
| formatted_results | STRING | Human-readable, line-broken summary of the matched products for quick review. | 1) Aspirin — NDC: 0000-0000-00 — Active ingredient(s): Aspirin — Manufacturer: Example Pharma |
| result_count | INT | Number of results returned after applying filters and limits. | 1 |
Important Notes¶
- Search modes: 'ndc' expects an NDC code, 'drug_name' searches by brand/generic name, 'set_id' uses a DailyMed set identifier, and 'ingredient' searches by active ingredient.
- Result limits: The 'limit' input is constrained to 1–100 to balance performance with completeness.
- Exact matching: Enabling 'exact_match' can significantly narrow results; disable it to broaden discovery.
- Inactive products: Set 'include_inactive' to true if you need historical or discontinued product data.
- Output parsing: 'results_json' is a STRING containing JSON; parse it in downstream steps if you need structured fields.
- API dependency: Results depend on DailyMed’s public Services v2 endpoints; network conditions or upstream changes can affect output shape and availability.
Troubleshooting¶
- Zero results returned: Try disabling 'exact_match', adjust the 'query' (e.g., remove dosage form), or switch 'search_type' (e.g., from drug_name to ingredient).
- Unexpectedly few results: Increase 'limit' and consider setting 'include_inactive' to true.
- No matches for NDC: Verify the NDC format and that the NDC exists in DailyMed; try without hyphens if the upstream service expects normalized values.
- Slow or failed requests: Check network connectivity and retry; large limits or transient DailyMed issues can cause timeouts.
- JSON parsing errors downstream: Ensure you parse the 'results_json' field as JSON; do not parse the formatted summary.
- Inconsistent fields across items: DailyMed entries vary by product; guard your downstream logic against missing or optional fields.