Get Lead Finder search results
curl --request GET \
--url https://app.bettercontact.rocks/api/v2/lead_finder/async/{request_id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://app.bettercontact.rocks/api/v2/lead_finder/async/{request_id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://app.bettercontact.rocks/api/v2/lead_finder/async/{request_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.bettercontact.rocks/api/v2/lead_finder/async/{request_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.bettercontact.rocks/api/v2/lead_finder/async/{request_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.bettercontact.rocks/api/v2/lead_finder/async/{request_id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.bettercontact.rocks/api/v2/lead_finder/async/{request_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "bc39ffbfc24cf043b748",
"status": "terminated",
"message": "Lead finder request is not terminated yet. Please try later",
"credits_consumed": 0,
"credits_left": 331,
"summary": {
"leads_found": 350,
"limit": 100,
"offset": 100,
"total": 100,
"valid": 62,
"catch_all": 18,
"catch_all_not_safe": 5,
"undeliverable": 3,
"not_found": 17,
"found": 41
},
"leads": [
{
"contact_id": 128374651,
"contact_first_name": "Elon",
"contact_last_name": "Musk",
"contact_full_name": "Elon Musk",
"contact_job_title": "Ceo",
"contact_seniority": "Cxo",
"contact_headline": "<string>",
"contact_industry": "Automotive",
"contact_gender": "male",
"contact_linkedin_profile_url": "https://www.linkedin.com/in/elonmusk",
"contact_location_continent": "North america",
"contact_location_country": "United states",
"contact_location_state": "Texas",
"contact_location_city": "Austin",
"contact_email_address": "[email protected]",
"contact_email_address_status": "deliverable",
"contact_email_address_provider": "Secret Provider",
"contact_phone_number": "+14155550101",
"company_name": "Tesla",
"company_domain": "tesla.com",
"company_description": "<string>",
"company_linkedin_url": "<string>",
"company_industry": "Automotive",
"company_type": "Public Company",
"company_keywords": [
"wine industry",
"wine"
],
"company_founded_year": 2003,
"company_employees_range_start": 10001,
"company_employees_range_end": 50000,
"company_head_quarters_city": "Austin",
"company_head_quarters_country": "United states",
"custom_fields": []
}
]
}{
"id": "bc39ffbfc24cf043b748",
"status": "processing",
"credits_left": 331,
"message": "Lead finder request is not terminated yet. Please try later"
}{
"success": false,
"error": "Your are not authorized. Please check your api_key."
}{
"success": false,
"message": "Lead finder request not found."
}Lead Finder - Get new leads
Get a Lead Finder Search results
Get leads from a submitted Lead Finder search.
GET
/
lead_finder
/
async
/
{request_id}
Get Lead Finder search results
curl --request GET \
--url https://app.bettercontact.rocks/api/v2/lead_finder/async/{request_id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://app.bettercontact.rocks/api/v2/lead_finder/async/{request_id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://app.bettercontact.rocks/api/v2/lead_finder/async/{request_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.bettercontact.rocks/api/v2/lead_finder/async/{request_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.bettercontact.rocks/api/v2/lead_finder/async/{request_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.bettercontact.rocks/api/v2/lead_finder/async/{request_id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.bettercontact.rocks/api/v2/lead_finder/async/{request_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "bc39ffbfc24cf043b748",
"status": "terminated",
"message": "Lead finder request is not terminated yet. Please try later",
"credits_consumed": 0,
"credits_left": 331,
"summary": {
"leads_found": 350,
"limit": 100,
"offset": 100,
"total": 100,
"valid": 62,
"catch_all": 18,
"catch_all_not_safe": 5,
"undeliverable": 3,
"not_found": 17,
"found": 41
},
"leads": [
{
"contact_id": 128374651,
"contact_first_name": "Elon",
"contact_last_name": "Musk",
"contact_full_name": "Elon Musk",
"contact_job_title": "Ceo",
"contact_seniority": "Cxo",
"contact_headline": "<string>",
"contact_industry": "Automotive",
"contact_gender": "male",
"contact_linkedin_profile_url": "https://www.linkedin.com/in/elonmusk",
"contact_location_continent": "North america",
"contact_location_country": "United states",
"contact_location_state": "Texas",
"contact_location_city": "Austin",
"contact_email_address": "[email protected]",
"contact_email_address_status": "deliverable",
"contact_email_address_provider": "Secret Provider",
"contact_phone_number": "+14155550101",
"company_name": "Tesla",
"company_domain": "tesla.com",
"company_description": "<string>",
"company_linkedin_url": "<string>",
"company_industry": "Automotive",
"company_type": "Public Company",
"company_keywords": [
"wine industry",
"wine"
],
"company_founded_year": 2003,
"company_employees_range_start": 10001,
"company_employees_range_end": 50000,
"company_head_quarters_city": "Austin",
"company_head_quarters_country": "United states",
"custom_fields": []
}
]
}{
"id": "bc39ffbfc24cf043b748",
"status": "processing",
"credits_left": 331,
"message": "Lead finder request is not terminated yet. Please try later"
}{
"success": false,
"error": "Your are not authorized. Please check your api_key."
}{
"success": false,
"message": "Lead finder request not found."
}Poll on
status, not on the HTTP status code.While the search is running this endpoint answers 202 Accepted with a body that has no leads
and no summary. Once it is done it answers 200 OK with status set to terminated.Always branch on body.status, never on the HTTP code alone.
See Request statuses for the full lifecycle and a polling recipe.404 also means the search was dropped because the balance ran out before it ran, which can
happen when several searches run in parallel. Nothing was charged: top up, then submit it again.Prefer the
webhook attribute of POST /lead_finder/async
over polling. See Webhooks.Response
Search finished. status is terminated, with leads present, possibly empty.
See Request statuses. A search that matched nothing is reported as terminated with an empty leads array.
Available options:
not_started, processing, terminated Example:
"terminated"
Was this page helpful?