Search leads
Search for people who match one or more Lead Finder criteria. This endpoint returns a compact result set intended for discovery, filtering, and selecting leads for further enrichment.
Use the returned lead uid and other lead details when queueing a lead for enrichment with the queue lead enrichments endpoint.
Request
Each request must include a non-empty search_criteria array. Every entry contains a criterion name, a value, and an operator. Build these entries from the current search criteria catalog:
name: use a criterion name exactly as returned infreetextorenumerated.value: forfreetextcriteria, send your own text. Forenumeratedcriteria, send a value returned by search criteria values. The value must match exactly, including letter case.operator: use only an operator listed in the criterion'soperators.INCLUDEnarrows the search to matching values, andEXCLUDEremoves matching values from the result set.- Multiple values: to match several values for the same criterion, add one
search_criteriaentry per value with the samename. The number of distinct values for one criterion and operator pair cannot exceed the criterion'smax_values. Identical values are counted once.nullmeans there is no limit.
For example, a criterion with "operators": ["INCLUDE"] and "max_values": 1 accepts only one value, sent with INCLUDE. A criterion with "operators": ["INCLUDE", "EXCLUDE"] and "max_values": 200 accepts up to 200 distinct values to include and up to 200 distinct values to exclude.
A request that does not follow these rules is rejected with 400 Bad Request before any credits are used. Criteria and allowed values can change over time, so do not hardcode the example values from this page.
This request can use account credits. Searching for leads and viewing returned lead data costs 1 credit per lead.
Endpoint
POST https://api.woodpecker.co/rest/v2/lead_finder/leads
Headers
x-api-key: {YOUR_API_KEY}
Content-Type: application/json
For details on how to authenticate your requests, please see the authentication guide.
Body
{
"search_criteria": [
{
"name": "INDUSTRY",
"value": "banking",
"operator": "INCLUDE"
},
{
"name": "CURRENT_JOB_TITLE",
"value": "ceo",
"operator": "INCLUDE"
},
{
"name": "LOCATION",
"value": "poland",
"operator": "EXCLUDE"
}
],
"size": 2,
"next_page": null
}
Body schema
| Field | Type | Required | Description |
|---|---|---|---|
search_criteria | array[object] | Yes | Non-empty list of filters to apply |
└─ name | string | Yes | Criterion name from the search criteria catalog. Case-sensitive. |
└─ value | string | Yes | Criterion value. For freetext criteria, any text. For enumerated criteria, a value returned by search criteria values, matched exactly (case-sensitive). |
└─ operator | string | Yes | Filter behavior: INCLUDE keeps matches, EXCLUDE removes matches. Must be one of the criterion's operators |
size | integer | No | Number of leads to return. Default: 1. Maximum: 50 for PREMIUM accounts and 25 for TRIAL accounts |
next_page | string/null | No | Pagination token returned by a previous search response. Available only for PREMIUM accounts |
Request samples
Search for leads with inclusion and exclusion filters
- cURL
- Python
- Java
- Node.js
- PHP
curl --request POST \
--url "https://api.woodpecker.co/rest/v2/lead_finder/leads" \
--header "x-api-key: {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--data '{
"search_criteria": [
{
"name": "INDUSTRY",
"value": "banking",
"operator": "INCLUDE"
},
{
"name": "LOCATION",
"value": "poland",
"operator": "EXCLUDE"
},
{
"name": "CURRENT_JOB_TITLE",
"value": "ceo",
"operator": "INCLUDE"
}
],
"size": 2,
"next_page": null
}'
import requests
def search_leads():
url = "https://api.woodpecker.co/rest/v2/lead_finder/leads"
headers = {
"x-api-key": "{YOUR_API_KEY}",
"Content-Type": "application/json"
}
payload = {
"search_criteria": [
{
"name": "INDUSTRY",
"value": "banking",
"operator": "INCLUDE"
},
{
"name": "LOCATION",
"value": "poland",
"operator": "EXCLUDE"
},
{
"name": "CURRENT_JOB_TITLE",
"value": "ceo",
"operator": "INCLUDE"
}
],
"size": 2,
"next_page": None
}
response = requests.post(url, headers=headers, json=payload)
if response.status_code == 200:
print("POST response:", response.json())
else:
print("POST failed with status:", response.status_code, response.text)
if __name__ == "__main__":
search_leads()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class WoodpeckerApiClient {
private static final String API_KEY = "{YOUR_API_KEY}";
public static void main(String[] args) {
searchLeads();
}
public static void searchLeads() {
try {
String url = "https://api.woodpecker.co/rest/v2/lead_finder/leads";
String jsonData = """
{
"search_criteria": [
{
"name": "INDUSTRY",
"value": "banking",
"operator": "INCLUDE"
},
{
"name": "LOCATION",
"value": "poland",
"operator": "EXCLUDE"
},
{
"name": "CURRENT_JOB_TITLE",
"value": "ceo",
"operator": "INCLUDE"
}
],
"size": 2,
"next_page": null
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(new URI(url))
.header("x-api-key", API_KEY)
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(jsonData))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() == 200) {
System.out.println("POST response: " + response.body());
} else {
System.err.println("POST request failed: " + response.statusCode());
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
const axios = require("axios");
async function searchLeads() {
const url = "https://api.woodpecker.co/rest/v2/lead_finder/leads";
const headers = {
"x-api-key": "{YOUR_API_KEY}",
"Content-Type": "application/json"
};
const data = {
search_criteria: [
{
name: "INDUSTRY",
value: "banking",
operator: "INCLUDE"
},
{
name: "LOCATION",
value: "poland",
operator: "EXCLUDE"
},
{
name: "CURRENT_JOB_TITLE",
value: "ceo",
operator: "INCLUDE"
}
],
size: 2,
next_page: null
};
try {
const response = await axios.post(url, data, { headers });
if (response.status === 200) {
console.log("POST response:", response.data);
} else {
console.error("POST request failed:", response.status);
}
} catch (error) {
console.error("Request error:", error.response?.status || error.message);
}
}
searchLeads();
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
use GuzzleHttp\Exception\RequestException;
$client = new Client([
'base_uri' => 'https://api.woodpecker.co/rest/v2/',
'headers' => [
'x-api-key' => getenv('WOODPECKER_API_KEY'),
'Content-Type' => 'application/json',
],
]);
try {
$response = $client->post('lead_finder/leads', [
'json' => [
'search_criteria' => [
[
'name' => 'INDUSTRY',
'value' => 'banking',
'operator' => 'INCLUDE',
],
[
'name' => 'LOCATION',
'value' => 'poland',
'operator' => 'EXCLUDE',
],
[
'name' => 'CURRENT_JOB_TITLE',
'value' => 'ceo',
'operator' => 'INCLUDE',
],
],
'size' => 2,
'next_page' => null
],
]);
echo $response->getStatusCode(), "\n";
echo $response->getBody(), "\n";
} catch (RequestException $e) {
echo "Error: ", $e->getMessage(), "\n";
if ($e->hasResponse()) {
echo $e->getResponse()->getBody(), "\n";
}
}
Response
Response examples
- 200
- 400
- 401
- 402
- 404
- 500
Preview of the leads matching the search criteria
{
"size": 2,
"leads": [
{
"uid": "https://www.linkedin.com/in/erlich-bachman-404xyz",
"full_name": "Erlich Bachman",
"first_name": "Erlich",
"last_name": "Bachman",
"gender": null,
"linkedin_url": "https://www.linkedin.com/in/erlich-bachman-404xyz",
"company_name": "Bachmanity",
"company_website": "bachmanity.com",
"industry": "Software Development",
"job_title": "CEO",
"job_title_role": null,
"job_title_levels": [],
"location_name": "Palo Alto, California, United States",
"city": null,
"state": null,
"country": null
},
{
"uid": "https://www.linkedin.com/in/jared-dunn-7c21ab",
"full_name": "Jared Dunn",
"first_name": "Jared",
"last_name": "Dunn",
"gender": null,
"linkedin_url": "https://www.linkedin.com/in/jared-dunn-7c21ab",
"company_name": "Pied Piper",
"company_website": "piedpiper.com",
"industry": "Software Development",
"job_title": "Chief Operating Officer",
"job_title_role": null,
"job_title_levels": [],
"location_name": "Palo Alto, California, United States",
"city": null,
"state": null,
"country": null
}
],
"total_found": 28639,
"next_page": "9c1f7a2e4b6d8035"
}
Profile fields depend on data availability. When a scalar profile value is not available, it is returned as null. When an array profile value is not available, it is returned as an empty array.
When no leads match the search criteria, the response is still 200 OK with an empty leads array:
{
"size": 25,
"leads": [],
"total_found": 0,
"next_page": null
}
Body schema
| Field | Type | Description |
|---|---|---|
size | integer | Number of leads requested in this page |
leads | array[object] | Lead search result items |
└─ uid | string | Lead identifier |
└─ full_name | string/null | Full name of the lead |
└─ first_name | string/null | First name |
└─ last_name | string/null | Last name |
└─ gender | string/null | Gender |
└─ linkedin_url | string/null | LinkedIn profile URL |
└─ company_name | string/null | Current company name |
└─ company_website | string/null | Current company website |
└─ industry | string/null | Current industry. The spelling can differ from the INDUSTRY values accepted in search requests |
└─ job_title | string/null | Current job title |
└─ job_title_role | string/null | Job title role when available |
└─ job_title_levels | array[string] | Job seniority levels. Empty when not available |
└─ location_name | string/null | Full human-readable location |
└─ city | string/null | City |
└─ state | string/null | State or region |
└─ country | string/null | Country |
total_found | integer | Total number of matches available for the current search |
next_page | string/null | Pagination token. Use it to request the next page of results. null when there are no more results |
The request was rejected. The details field describes the reason. Requests rejected because of invalid search criteria do not use credits.
Common cases to check:
- Missing filters:
search_criteriais missing or empty. - Unknown criterion:
nameis not a criterion returned by Get search criteria. - Unsupported operator:
operatoris not listed in the criterion'soperators. - Too many values: the number of distinct values for one criterion and operator pair exceeds the criterion's
max_values. Identical values are counted once. - Invalid enumerated value: the value does not exactly match a value returned by Get search criteria values, including letter case.
- Invalid pagination or search criteria:
next_pageis invalid or expired, or the search criteria cannot be processed. - Pagination on a TRIAL account:
next_pageis sent by a TRIAL account.
{
"title": "Bad Request",
"status": 400,
"details": "Unsupported search criterion value: name=INDUSTRY, operator=INCLUDE, value=Software Development",
"timestamp": "2025-03-05 17:57:00",
"extra": null
}
Body schema
| Field | Type | Description |
|---|---|---|
title | string | A short title describing the error |
status | integer | The HTTP status code |
details | string | A detailed message explaining the validation or request problem |
timestamp | string | The timestamp when the error occurred, YYYY-MM-DD HH:MM:SS UTC |
extra | string/null | Additional information about the error, when available |
An issue with authorization. Please review the authentication guide.
{
"title": "Unauthorized",
"status": 401,
"detail": "Invalid api key",
"timestamp": "2025-03-05 17:57:00"
}
Body schema
| Field | Type | Description |
|---|---|---|
title | string | A short title describing the error |
status | integer | The HTTP status code |
detail | string | A detailed message explaining the authorization problem |
timestamp | string | The timestamp when the error occurred, YYYY-MM-DD HH:MM:SS UTC |
Not enough credits. An account admin can manage credits in the billing section of the app.
{
"title": "Payment Required",
"status": 402,
"details": "Insufficient credits to find leads",
"timestamp": "2025-03-05 17:57:00",
"extra": null
}
Body schema
| Field | Type | Description |
|---|---|---|
title | string | A short title describing the error |
status | integer | The HTTP status code |
details | string | A detailed message explaining the payment or credits problem |
timestamp | string | The timestamp when the error occurred, YYYY-MM-DD HH:MM:SS UTC |
extra | string/null | Additional information about the error, when available |
Please review the request URL.
{
"title": "Not Found",
"status": 404,
"details": "Requested resource does not exist",
"timestamp": "2025-03-05 17:57:00"
}
Body schema
| Field | Type | Description |
|---|---|---|
title | string | A short title describing the error |
status | integer | The HTTP status code |
details | string | A detailed message explaining the error |
timestamp | string | The timestamp when the error occurred, YYYY-MM-DD HH:MM:SS UTC |
Unexpected error, please try again later.
{
"title": "Internal server error",
"status": 500,
"details": "An unexpected error has occurred. Please try again later.",
"timestamp": "2025-03-05 17:57:00"
}
Body schema
| Field | Type | Description |
|---|---|---|
title | string | A short title describing the error |
status | integer | The HTTP status code |
details | string | A detailed message explaining the error |
timestamp | string | The timestamp when the error occurred, YYYY-MM-DD HH:MM:SS UTC |
Pagination
This endpoint uses cursor-based pagination. The response includes a next_page token when another page is available. Store the token and resend it exactly as returned in the next request body. An invalid or expired token returns 400 Bad Request.
Fetching additional pages is available only for PREMIUM accounts. TRIAL accounts can retrieve only the first page of results. Requests for additional pages from TRIAL accounts return 400 Bad Request.
Request first page:
curl --request POST \
--url "https://api.woodpecker.co/rest/v2/lead_finder/leads" \
--header "x-api-key: {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--data '{
"search_criteria": [
{
"name": "INDUSTRY",
"value": "banking",
"operator": "INCLUDE"
}
],
"size": 2
}'
Example response excerpt:
{
"size": 2,
"leads": [
{
"uid": "https://www.linkedin.com/in/erlich-bachman-404xyz",
"full_name": "Erlich Bachman"
}
],
"total_found": 28639,
"next_page": "9c1f7a2e4b6d8035"
}
Request the next page:
curl --request POST \
--url "https://api.woodpecker.co/rest/v2/lead_finder/leads" \
--header "x-api-key: {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--data '{
"search_criteria": [
{
"name": "INDUSTRY",
"value": "banking",
"operator": "INCLUDE"
}
],
"size": 2,
"next_page": "9c1f7a2e4b6d8035"
}'