Dashboard

Search APIs Overview

FHIRfly Search APIs let you find healthcare data when you don't know the exact code. Use full-text search with filters to discover drugs, providers, lab codes, and more.

Search vs. Lookup

FeatureLookup APIsSearch APIs
Use caseYou have the codeYou need to find the code
InputExact code (NDC, NPI, etc.)Text query + optional filters
ResultsSingle recordMultiple matching records
ExampleGET /v1/ndc/60505008100GET /v1/ndc/search?q=metformin

Available Search Endpoints

APIEndpointDescription
NDCGET /v1/ndc/searchSearch drug products by name, ingredient, strength
NPIGET /v1/npi/searchSearch healthcare providers by name, specialty, location
RxNormGET /v1/rxnorm/searchSearch drug terminology by name, ingredient, term type
RxClassGET /v1/rxclass/searchSearch drug classifications by name, class type
UCUMGET /v1/ucum/searchSearch units of measure by name, property, kind
LOINCGET /v1/loinc/searchSearch lab codes by name, component, class
ICD-10GET /v1/icd10/searchSearch diagnosis and procedure codes
CVXGET /v1/cvx/searchSearch vaccine codes
MVXGET /v1/mvx/searchSearch vaccine manufacturer codes
FDA LabelsGET /v1/fda-label/searchSearch drug labels by name, manufacturer, substance
SNOMED CTGET /v1/snomed/searchSearch clinical concepts by text, category, semantic tag
HCPCSGET /v1/hcpcs/searchSearch HCPCS Level II procedure and supply codes
MS-DRGGET /v1/msdrg/searchSearch diagnosis related groups by title, MDC, type

Common Features

All search endpoints share these capabilities:

Text Search with Fuzzy Matching

Search queries automatically handle typos and variations:

Node.js
// Finds "lisinopril" even with typo
const results = await client.ndc.search({ q: "lisnopril" });

Filters

Narrow results with type-specific filters:

Node.js
const results = await client.ndc.search({
  q: "metformin",
  dosage_form: "TABLET",
  is_active: true
});

Faceted Results

Search responses include facets showing the distribution of results:

{
  "facets": {
    "dosage_form": {
      "TABLET": 186,
      "CAPSULE": 42,
      "SOLUTION": 15
    },
    "product_type": {
      "HUMAN PRESCRIPTION DRUG": 170,
      "DRUG FOR FURTHER PROCESSING": 16
    }
  },
  "items": [...],
  "total": 186
}

Use facets to build filter UIs or refine searches programmatically.

Pagination

Control result sets with limit and page:

ParameterDefaultMaximumDescription
limit20100Results per page
page1100Page number

Maximum accessible results: 10,000 (100 pages × 100 items). For larger datasets, use filters to narrow your search.

Response Shapes

Control response detail level with the shape parameter:

ShapeDescription
compactMinimal fields for lists (default for search)
standardCore structured data
fullComplete data with provenance

Response Format

All search responses follow this structure:

{
  "items": [
    { /* result 1 */ },
    { /* result 2 */ }
  ],
  "total": 186,
  "has_more": true,
  "page": 1,
  "limit": 20,
  "facets": { /* aggregations */ },
  "meta": {
    "legal": {
      "source_name": "FDA NDC Directory",
      "license": "public_domain",
      "citation": "..."
    }
  }
}

Authentication

Search APIs require the same authentication as lookup APIs:

Node.js
import { Fhirfly } from "@fhirfly-io/terminology";

const client = new Fhirfly({ apiKey: "YOUR_API_KEY" });
const results = await client.ndc.search({ q: "advil" });

Required Scopes

Each search endpoint requires a dedicated search scope:

EndpointRequired Scope
/v1/ndc/searchndc.search
/v1/npi/searchnpi.search
/v1/rxnorm/searchrxnorm.search
/v1/rxclass/searchrxclass.search
/v1/ucum/searchucum.search
/v1/loinc/searchloinc.search
/v1/icd10/searchicd10.search
/v1/cvx/searchcvx.search
/v1/mvx/searchmvx.search
/v1/fda-label/searchfda-label.search
/v1/snomed/searchsnomed.search
/v1/hcpcs/searchhcpcs.search
/v1/msdrg/searchmsdrg.search

Search scopes are separate from read scopes because search operations use more compute resources. New credentials include both read and search scopes by default.