Skip to main content

Before you begin

You need:
  • An API base URL assigned by lev8.
  • An active API key with Entity Search access.
  • Enough credits to reserve the maximum cost of the request.
  • A server-side HTTP client that can consume Server-Sent Events (SSE).
1

Set server-side environment variables

Keep API keys out of browser code, mobile apps, source control, and logs.
2

Check available credits

Confirm that the API key’s billing account has credits available for a new request.
The returned available_credits already excludes credits reserved by requests that are still in progress.
3

Send a streaming search request

Use --no-buffer so curl prints each SSE event as it arrives. Supply a unique Idempotency-Key for the logical request.
4

Process events until [DONE]

A successful stream contains zero or more entity_search_batch objects, one entity_search_done object, and a final [DONE] sentinel.
Save the X-Request-Id response header and the leads_search_id from stream events. They identify different layers of the request and are both useful when diagnosing a search.

Next steps

Check your balance

Read the current available-credit response and caching behavior.

Request fields

Choose an entity type, limit, enrichments, and deduplication inputs.

Find contact details

Request an email address or phone number as a JSON response.

Build a resilient consumer

Parse complete SSE frames, deduplicate batches, and handle stream errors.