Response Shapes
FHIRfly APIs support three response shapes to optimize for different use cases.
Overview
Use the shape query parameter to control the amount of data returned:
GET /v1/ndc/0069-0151-01?shape=compact
GET /v1/ndc/0069-0151-01?shape=standard
GET /v1/ndc/0069-0151-01?shape=full
Shape Comparison
| Shape | Use Case | Data Included |
|---|---|---|
| compact | Lists, autocomplete | Code, display name, status |
| standard | Most integrations | Core structured data |
| full | AI agents, auditing | Everything + provenance |
Compact Shape
Minimal data for lists and autocomplete scenarios. Optimized for bandwidth.
curl -X GET "https://api.fhirfly.io/v1/ndc/0069-0151-01?shape=compact" \
-H "x-api-key: YOUR_API_KEY"
{
"data": {
"ndc": "0069-0151-01",
"display": "Lipitor 10 MG Oral Tablet",
"status": "active"
},
"meta": {
"legal": {
"license": "public_domain"
}
}
}
Standard Shape (Default)
Core structured data for most integration scenarios.
curl -X GET "https://api.fhirfly.io/v1/ndc/0069-0151-01?shape=standard" \
-H "x-api-key: YOUR_API_KEY"
{
"data": {
"ndc": "0069-0151-01",
"ndc11": "00069015101",
"product_name": "Lipitor",
"labeler_name": "Pfizer Laboratories",
"dosage_form": "TABLET, FILM COATED",
"active_ingredients": [
{
"name": "ATORVASTATIN CALCIUM",
"strength": "10 mg"
}
]
},
"meta": {
"legal": {
"license": "public_domain",
"citation": "FDA NDC Directory"
}
}
}
Full Shape
Complete data with provenance information. Designed for AI agents that need source attribution.
curl -X GET "https://api.fhirfly.io/v1/ndc/0069-0151-01?shape=full" \
-H "x-api-key: YOUR_API_KEY"
{
"data": {
"ndc": "0069-0151-01",
"ndc11": "00069015101",
"product_name": "Lipitor",
"generic_name": "atorvastatin calcium",
"labeler_name": "Pfizer Laboratories Div Pfizer Inc",
"dosage_form": "TABLET, FILM COATED",
"route": "ORAL",
"marketing_status": "Prescription",
"dea_schedule": null,
"active_ingredients": [ /* ... */ ],
"packaging": [ /* ... */ ],
"pharm_classes": [ /* ... */ ]
},
"meta": {
"source": {
"name": "FDA NDC Directory",
"url": "https://www.fda.gov/drugs/drug-approvals-and-databases/national-drug-code-directory",
"version": "2026-01-01",
"fhirfly_updated_at": "2026-01-02T03:00:00Z",
"fhirfly_etl_version": "1.0.0"
},
"legal": {
"license": "public_domain",
"citation": "U.S. Food and Drug Administration. National Drug Code Directory.",
"attribution_required": false,
"commercial_use": true
}
}
}
Display Modifier
Add human-readable formatted fields with include=display:
GET /v1/ndc/0069-0151-01?include=display
This adds a display field to each object with a pre-formatted human-readable string.
MCP Default Shape
When accessing FHIRfly through MCP (Model Context Protocol), the default shape is full to provide AI assistants with complete provenance information for accurate citations.
Choosing a Shape
| Scenario | Recommended Shape |
|---|---|
| Autocomplete dropdown | compact |
| Form field validation | compact |
| Patient record display | standard |
| EHR integration | standard |
| AI agent / LLM | full |
| Compliance audit | full |
| Research / analysis | full |