Skip to main content

Lead Search

Search the lead database using filters and pagination.

Endpoint​

POST /api/public/search

Authentication​

Use an API key header as described in the Authentication guide.

Retry a page safely​

Send an optional Idempotency-Key header when a network error could make it unclear whether a page completed. Generate one key per logical page. A UUID is a suitable key. Keep the key and search parameters with your job state before sending the request.

curl https://dievio.com/api/public/search \
-H "Authorization: Bearer $DIEVIO_API_KEY" \
-H "Idempotency-Key: $SEARCH_PAGE_KEY" \
--json '{"company_websites":["example.com"],"_page":1,"_per_page":10,"max_results":10}'

A successful response can be replayed for one hour after completion. Retrying with the same key and parameters returns the saved page, including after the available balance reaches zero. Replayed responses include Idempotency-Replayed: true and use no additional credits. The key is scoped to the API account and accepts 1–128 characters from letters, digits, dots, underscores, colons and hyphens.

  • If the same request is still running, HTTP 409 includes Retry-After. Wait and retry with the same key.
  • HTTP 409 without Retry-After means the key already belongs to different parameters. Use a new key for a different request or page.
  • An insufficient-credit HTTP 402 can be retried with the same key after topping up.
  • Keyed responses are limited to 2 MiB. If HTTP 413 says the response is too large to replay, request a smaller page with a new key. That attempt is unpaid.
  • After one hour, a retry may run and charge as a new request. Requests without a key retain the ordinary per-request billing behaviour.

Request body​

Pagination​

  • _page (default 1)
  • _per_page (default 25, max 100000)
  • max_results (default 500, max 100000)

Output flags​

  • _include_raw (default false) — include a raw object with original fields
  • include_company_domain (default false) — return company_domain for each record. Requires at least one valid website in company_websites. This flag works with _include_raw: false.
  • include_emails (default true)
  • include_phones (default false)
  • email_status (default all) — all | verified | likely | work. Use work to require an address in work_email. The verified value can include profiles with a personal email only. These filters check stored fields. Check deliverability separately.

Filters​

All filter fields and allowed values are listed in Filters.

Response fields​

  • count: number of rows returned in this page
  • preview_count: same as count
  • preview_data: array of lead records
  • preview_data[].company_domain: normalized domain used for company matching when include_company_domain is enabled
  • page, per_page, total_pages, total_count, has_more, next_page
  • search_id: currently null
  • counting: currently false

Errors​

  • 400 — Invalid company-domain flag or missing or invalid websites when the flag is enabled
  • 401 — Missing or invalid API key
  • 402 — Not enough API credits
  • 502 — Lead service error (upstream VPS)
  • 500 — Server error

Examples​

Request​

curl -X POST https://dievio.com/api/public/search \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"_per_page": 1,
"_page": 1,
"max_results": 1,
"_include_raw": false,
"include_company_domain": true,
"company_websites": ["acme.com"],
"job_titles": ["Founder", "CEO"],
"email_status": "work",
"job_title_seniority": ["owner", "cxo"],
"person_location_country": ["United States"],
"include_emails": true,
"include_phones": false
}'

Response​

{
"success": true,
"count": 1,
"total_count": 1,
"preview_count": 1,
"preview_data": [
{
"first_name": "Jane",
"last_name": "Doe",
"full_name": "Jane Doe",
"email_status": "found",
"phone_status": "not_found",
"job_title": "CEO",
"company": "Acme Inc",
"company_domain": "acme.com",
"city": "San Francisco",
"state": "California",
"country": "United States",
"work_email": "jane@acme.com",
"personal_emails": ["jane@gmail.com"],
"mobile_phone": null,
"linkedin_url": "https://www.linkedin.com/in/janedoe",
"linkedin_status": "found",
"facebook_status": "not_found",
"twitter_status": "found"
}
],
"message": "Search completed.",
"page": 1,
"per_page": 1,
"total_pages": 1,
"has_more": false,
"next_page": null,
"search_id": null,
"counting": false,
"max_results": 1
}

Notes​

  • Credits are deducted for the number of leads returned.
  • A page is charged only if the balance covers its returned records. HTTP 402 leaves the page unpaid so you can top up and retry the same page.
  • Requesting company_domain does not add a separate credit charge. Keep include_company_domain fixed across pages and retries.
  • Keep _per_page, filters, and max_results fixed when using next_page. The response field per_page is the page size used for offsets and count is the number of records returned.
  • total_count is a capped paging value. The API reports max_results if the current window is filled. When a page ends early, it reports (page - 1) * per_page + count. Use has_more or next_page to decide when to stop.
  • search_id is currently null and counting is false for this endpoint.