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-Aftermeans 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 arawobject with original fieldsinclude_company_domain(default false) — returncompany_domainfor each record. Requires at least one valid website incompany_websites. This flag works with_include_raw: false.include_emails(default true)include_phones(default false)email_status(default all) —all|verified|likely|work. Useworkto require an address inwork_email. Theverifiedvalue 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 pagepreview_count: same ascountpreview_data: array of lead recordspreview_data[].company_domain: normalized domain used for company matching wheninclude_company_domainis enabledpage,per_page,total_pages,total_count,has_more,next_pagesearch_id: currentlynullcounting: currentlyfalse
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_domaindoes not add a separate credit charge. Keepinclude_company_domainfixed across pages and retries. - Keep
_per_page, filters, andmax_resultsfixed when usingnext_page. The response fieldper_pageis the page size used for offsets andcountis the number of records returned. total_countis a capped paging value. The API reportsmax_resultsif the current window is filled. When a page ends early, it reports(page - 1) * per_page + count. Usehas_moreornext_pageto decide when to stop.search_idis currentlynullandcountingisfalsefor this endpoint.