OpenFDA NDC Directory¶
Queries the OpenFDA National Drug Code (NDC) Directory to search or count records matching a specified field and value. Supports both fuzzy and exact matching and returns the API results along with response metadata. Useful for discovering drug products by brand, generic name, dosage form, route, ingredients, and packaging details.

Usage¶
Use this node when you need to look up drug product information from the FDA's NDC Directory. Select a field to search (e.g., brand name), provide a value (e.g., "aspirin"), choose whether to search or count, and optionally toggle exact matching. This node is typically placed early in a workflow to fetch data that will be parsed or analyzed by subsequent nodes.
Inputs¶
| Field | Required | Type | Description | Example |
|---|---|---|---|---|
| field_value | True | STRING | The value to search for within the selected field. If exact_match is enabled, the value must match exactly. | aspirin |
| field | True | CHOICE | Which NDC Directory field to query. Available options map to OpenFDA fields: active ingredient name → active_ingredients.name, active ingredient strength → active_ingredients.strength, brand name → brand_name, generic name → generic_name, dosage form → dosage_form, route → route, packaging description → packaging.description. | brand name |
| action | True | CHOICE | Select the query mode. 'search' returns matching records. 'count' returns aggregation/counts for the selected field and value. | search |
| exact_match | True | BOOLEAN | If true, performs an exact match against the selected field; otherwise performs a broader term search. | false |
| limit | True | INT | Maximum number of results to return. Minimum is 1. Higher values may be constrained by API limits. | 5 |
Outputs¶
| Field | Type | Description | Example |
|---|---|---|---|
| results | STRING | JSON string containing the list of matched records or counts, depending on the action. | {"results": [{"brand_name": "ASPIRIN", "generic_name": "ASPIRIN"}]} |
| metadata | STRING | JSON string containing the OpenFDA response metadata, such as request details and results paging info. | {"meta": {"results": {"skip": 0, "limit": 5}}} |
Important Notes¶
- Field options: The displayed field names map to OpenFDA API fields as documented in the input description.
- Search vs. Count: 'search' returns records; 'count' returns aggregation results rather than full records.
- Exact matching: Enabling exact_match narrows results and may return zero matches if the value does not exactly match.
- API constraints: The underlying OpenFDA service may impose rate limits and maximum page sizes that can affect large queries.
- Output format: Both outputs are JSON strings; parse them in downstream nodes if you need to extract specific values.
Troubleshooting¶
- No results returned: Try disabling exact_match, using a different field, or broadening the field_value.
- Unexpected counts or empty aggregations: Ensure 'action' is set correctly and that the field supports counting in the OpenFDA dataset.
- Rate limit or network errors: Reduce request frequency, lower the limit, and retry after a short delay.
- Invalid field behavior: Verify you selected a field from the provided options; custom fields are not supported in this node.