OpenFDA NDC Directory¶
Queries the FDA's National Drug Code (NDC) Directory via the OpenFDA API. Supports search and count operations across common NDC attributes with optional exact-match filtering. Returns results and request metadata as JSON strings.

Usage¶
Use this node to look up drugs in the FDA NDC Directory by brand, generic name, dosage form, route, or packaging attributes. Select a field, provide a value, choose search or count, and optionally enforce exact matching. The node outputs JSON strings suitable for downstream parsing, analysis, or display.
Inputs¶
| Field | Required | Type | Description | Example | 
|---|---|---|---|---|
| field_value | True | STRING | The value to search for in the selected field. For example, a brand or generic name, a dosage form, or a route. | aspirin | 
| field | True | select from: ["active ingredient name", "active ingredient strength", "brand name", "generic name", "dosage form", "route", "packaging description"] | The NDC Directory field to query against. These map to OpenFDA fields internally. | brand name | 
| action | True | select from: ["search", "count"] | Choose 'search' to retrieve matching records or 'count' to aggregate counts by the selected field. | search | 
| exact_match | True | BOOLEAN | If true, performs an exact match on the selected field. If false, performs a broader match. | false | 
| limit | True | INT | Maximum number of results to return. Minimum is 1. | 10 | 
Outputs¶
| Field | Type | Description | Example | 
|---|---|---|---|
| results | STRING | JSON string of the OpenFDA API results for the query. For 'search', this is an array of records; for 'count', this is an array of count buckets. | [{ "brand_name": "ASPIRIN", "generic_name": "ASPIRIN", ... }] | 
| metadata | STRING | JSON string containing metadata from the OpenFDA API response (e.g., query parameters and result set information). | { "results": {"skip": 0, "limit": 10}, "disclaimer": "..." } | 
Important Notes¶
- Exact match toggles an exact term query on the selected field, which is useful when you need precise results.
- The 'count' action aggregates results by the selected field and respects the limit as the number of buckets returned.
- Both outputs are JSON strings; parse them downstream if you need to extract fields.
- Supported fields map to OpenFDA NDC fields internally: active_ingredients.name, active_ingredients.strength, brand_name, generic_name, dosage_form, route, packaging.description.
- This node targets the OpenFDA /drug/ndc.json endpoint.
Troubleshooting¶
- No results returned: Verify the field and field_value combination. Try disabling exact_match or adjusting the value to be less restrictive.
- Network error: Check internet connectivity and the OpenFDA API status; retry later.
- Malformed or unexpected output: Ensure downstream nodes parse the results and metadata as JSON strings before accessing fields.
- Count results seem limited: Increase the 'limit' to retrieve more count buckets.
- Unexpected matches with exact_match disabled: Enable exact_match to restrict results to exact term matches.