SDK and CLI
TypeScript SDK
@healthcare.dev/sdk: typed client with retries, pagination and batch helpers.
npm i @healthcare.dev/sdkimport { HealthcareDev, NotFoundError } from "@healthcare.dev/sdk";
const hdev = new HealthcareDev(); // reads HDEV_API_KEY
const { data, meta } = await hdev.codes.get("icd10cm", "E11.9");
console.log(data.display, data.billable, meta.data_version);
// One page, or every result
const page = await hdev.codes.search("icd10cm", { q: "type 2 diabetes kidney", billable: true });
for await (const code of hdev.codes.iterate("hcpcs", { q: "wheelchair" })) console.log(code.code);
// Hierarchy, batch (any length, split into requests of 100) and drugs
const tree = await hdev.codes.hierarchy("icd10cm", "E11.22");
const many = await hdev.codes.batch("icd10cm", ["E11.9", "I10", "NOPE"]);
const product = await hdev.drugs.ndc("0002-0152-01"); // includes linked RxNorm concepts
try {
await hdev.codes.get("icd10cm", "XYZ");
} catch (err) {
if (err instanceof NotFoundError) console.log(err.detail);
}Behavior
- Retries: 429
rate-limited, 5xx and network errors are retried twice with exponential backoff and jitter, honoringRetry-After.QuotaExceededErroris never retried. - Errors: every failure is a
HealthcareDevError; API problems areApiErrorsubclasses withstatus, the stable problemcode,detailandrequestId. - Options:
apiKey,baseUrl,maxRetries(2),timeoutMs(30,000),fetch,userAgent. - Runs on Node 18+, Deno, Bun and edge runtimes. Never put a live key in browser code.
Types are generated from the same OpenAPI spec as this reference, so they never drift from the API. A Python SDK is planned.