Getting started
Four calls: create a token, confirm it works, queue a website analysis, read the result. About two minutes.
The base URL is the app's own host, with /api appended. Below it is written
as $BASE:
export BASE="https://leadcubs.com/api"
1. Create a token
Tokens are created in the dashboard, under Settings → Integrations → API tokens, not through the API. A token cannot create another token, which is why: a leaked token must not be able to mint a replacement for itself.
Pick a scope when you create it. Read and write is the default; choose Read only for anything that should never be able to spend credits or delete a record. See Authentication.
The value is shown once. Store it immediately.
export LEADCUBS_TOKEN="1|gVJm0rE8ZO..."
Your plan caps how many tokens you can hold at once: 5 on Free and Pro, 20 on Team. Every plan can create them; what a plan changes is the request budget (see Rate limits).
2. Confirm the token
curl -s "$BASE/me" \
-H "Authorization: Bearer $LEADCUBS_TOKEN" \
-H "Accept: application/json"
{
"data": {
"id": 4,
"email": "you@acme.agency",
"name": "Acme Agency",
"plan": "pro",
"credits": {
"total": 50,
"monthly": 0,
"bonus": 50,
"monthly_allowance": 150,
"resets_at": null
},
"token": { "name": "ci-pipeline", "abilities": ["read", "write"] },
"limits": { "requests_per_day": 5000 },
"costs": {
"website_analysis": 2,
"lead_enrich": 1,
"lead_analysis": 2,
"draft_regenerate": 1,
"search_result_enriched": 2,
"search_result_basic": 1,
"profile_polish": 1
}
}
}
Make this the first call in any integration. It is the cheapest proof the credential is live, and it answers the four things a client needs before it does anything else:
credits.totalis what you have to spend.costsis what everything charges, straight from our own pricing configuration. Read your prices from here rather than from the table in Credits, and they cannot go stale on you.token.abilitiesis what this key is allowed to do, so you can find out before a call rather than from a403after one.limits.requests_per_dayis your daily request budget, ornullif your plan has none.
token is null if you are authenticated by a browser session rather than a
token.
3. Queue a website analysis
One URL in, a scored report out. This is the smallest useful thing the API does, so it is the right first call.
curl -s -X POST "$BASE/website-analyses" \
-H "Authorization: Bearer $LEADCUBS_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com"}'
{
"data": {
"id": 1,
"url": "https://example.com",
"name": "example.com",
"status": "analyzing",
"analyzed_at": null,
"created_at": "2026-11-04T14:25:57.000000Z"
}
}
201, and the work has not happened yet. status is analyzing, data is
absent and two credits have already been charged. name is optional in the
request and defaults to the URL's host.
If you do not have the credits, this call returns 402 and nothing is queued.
See Credits.
4. Read the result
Poll the record until status leaves analyzing:
curl -s "$BASE/website-analyses/1" \
-H "Authorization: Bearer $LEADCUBS_TOKEN" \
-H "Accept: application/json"
{
"data": {
"id": 1,
"url": "https://example.com",
"status": "done",
"data": { "gmb": { "available": false, "rating": null }, "...": "..." },
"analyzed_at": "2026-11-04T14:26:13.000000Z"
}
}
status is one of analyzing, done, failed. The run above took 16
seconds. Poll every 5 seconds and give up after two minutes; see
Asynchronous work for the loop and for the search
case, which takes a minute or two rather than seconds.
5. Or just search once
Everything above analyses one site you already know about. To find businesses, there are two shapes, and most integrations want the first:
curl -s -X POST "$BASE/searches" \
-H "Authorization: Bearer $LEADCUBS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"verticals": ["plumber"], "location": "Lyon", "limit": 20}'
{ "data": { "id": 7, "status": "queued", "location": "Lyon", "limit": 20, "results_count": 0 } }
202, and nothing has happened yet. Poll it, then read what it found:
GET /searches/7 -> status: queued | running | done | failed
GET /leads?search_run_id=7
status carries Retry-After until it settles, same as a website analysis.
When results_count is 0 and reason is exhausted, every business in that
area had already been served to you — nothing was charged, and the next move is
a wider location or a different keyword.
It leaves nothing behind. No schedule, no object to delete, and it never spends again. That is the difference from a radar, which is a standing order: it keeps running on its cadence until you pause it.
Saying where, precisely
A place name is resolved for you, and for most integrations that is enough. To
say exactly where to start instead, send location_geo — accepted on
POST /searches:
{
"verticals": ["plumber"],
"location": "Rennes",
"location_geo": {
"type": "circle",
"center": { "lat": 48.1119, "lng": -1.6742 },
"radius": 15000
}
}
radius is in metres. location is still required: it is the label the
lead is filed under and part of the coverage key, so keep it meaningful.
By default it is a starting point, not a boundary. The circle says where the first search sits and how wide it is; as that ground is exhausted the search works outward from the same centre, so results can land outside the radius you gave. The outer bound is then a platform-wide maximum distance, not your number. That is the right behaviour for "find me customers near this town".
Send stay_within_radius when the circle is a promise. If you are drawing
that circle on a map for your own user, add it and nothing outside the radius
comes back:
{
"verticals": ["plumber"],
"location": "Rennes",
"location_geo": { "type": "circle", "center": { "lat": 48.1119, "lng": -1.6742 }, "radius": 15000 },
"stay_within_radius": true
}
It needs location_geo — sending it without a circle is a 422 rather than a
silently unbounded search. You are charged only for the leads you receive, not
for the ones outside that we discarded.
Two consequences worth designing around. A bounded search is one search of
that circle, so a large radius is covered to the depth a single pass returns
rather than swept exhaustively — small circles get the better of it. And it
reaches exhausted sooner by construction, because there is nowhere further to
go: once that circle is spent it stays spent, where an unbounded search keeps
widening into the ground around it.
Reading leads in bulk
GET /leads is paginated — per_page up to 200, and page to walk it. Filter
and sort on the server: group, status, sort (newest is the default and
is stable, so a row cannot appear on two pages or on none), and read
group_counts off the response rather than counting the page you loaded.
For an incremental sync, use the batch id, not a timestamp. There is no
since filter, and you do not want one: every POST /searches hands back a run
id, and GET /leads?search_run_id={id} returns exactly that batch and nothing
else. No clock skew, no overlap window, no re-walking a list that only grows.
radar_id filters the same way, for leads a radar produced in the dashboard;
nothing an API key does creates one.
Each lead carries latitude and longitude, so you can compute a distance
without geocoding the address yourself. Both are null on a lead whose
listing carried no coordinates, and on anything found before we started keeping
them — null rather than 0,0, which is a real location in the Gulf of Guinea
and would put the lead 5000km from everything. A lead with no coordinates is
never returned by a stay_within_radius search, since we cannot show it is
inside.
Where to go next
-
Analysing one site at a time is the whole of Website Analysis. You now have it.
-
Finding businesses once is
POST /searches, above. Start here. -
Finding them continuously is a loop around
POST /searcheson your own schedule. Repeat the same keywords and location, and the coverage picks up where it left off: you are never served or charged for a business you have already been given. An area that runs out answersdonewithreason: "exhausted", no results and no credits.Our scheduled searches — radars — are a dashboard feature and are not reachable with an API key. See Serving your own customers for why.
-
The full endpoint list, with every parameter and response shape, is the generated reference.