Skip to main content
The official Node.js SDK for the Data Legion API. Written in TypeScript with zero external dependencies.

Installation

Requires Node.js 20+.

Authentication

Get an API key by signing up for free; it’s available in your dashboard after approval. The same key works across the API, SDKs, MCP server, and CLI.

Person

Enrichment

Look up a person by email, phone, name, LinkedIn, or other identifiers.
Return multiple matches with confidence scores by setting multiple_results: true.
Query people using a SQL SELECT against the people table. The query must start with SELECT and must not include a LIMIT clause — pass limit as a parameter.

Discovery

Find people using natural language.

Company

Enrichment

Look up a company by domain, name, ticker, or LinkedIn.

Search

Query companies using SQL.

Discovery

Find companies using natural language.

Utility Endpoints

Utility endpoints are free and don’t consume credits.

Clean Fields

Hash Email

Validate Data

Report a Data Issue

Found something wrong in a record? Report it against its legion_id — see Report a Data Issue for the issue_type/issue_level rules.
Company records use client.utility.reportCompany() with the same parameters.

Response Metadata

After each request, response metadata is available on the client.
On search/discover, totalCountStatus tells you how the response total was derived: "exact" (true count), "estimate" (the query planner’s row estimate — returned on broad queries where an exact count is too expensive, so treat it as a magnitude), or "page" (count unavailable; total is just the returned page size).

Field Filtering

Control which fields are returned in the response.

Error Handling

The SDK throws typed error classes for different error conditions.

Configuration

TypeScript

The SDK is written in TypeScript and exports all request and response types.

Resources