Getting started
loclay API
Run live Google Maps lead jobs from your own code and get back enriched leads: the decision maker when the business’s site names one, every published email and phone, and socials, each from a real source.
Jobs run exactly like searches in the app and use the same credits. Every plan can use the API, including the free trial.
https://loclay.cc/api/v1Quickstart
- 1
Create a key
In Settings → API keys, name a key and copy it. Save it as
LOCLAY_API_KEY. - 2
Find your locations
Look up each city with Locations and keep its
id, likeUS:TX:Austin. - 3
Create a job
Send a business type and one or more location ids. You get back a job
idright away. - 4
Wait for it
A job takes a few minutes while we read each business’s website. Poll its status every 15–30 seconds.
- 5
Fetch the leads
Once
statusiscompleted, fetch every lead as JSON.
# 1. Find the location (no key needed)
curl "https://loclay.cc/api/v1/locations?q=austin&country=US&limit=1"
# → { "locations": [{ "id": "US:TX:Austin", "name": "Austin, TX, United States", … }] }
# 2. Create a job
curl -X POST https://loclay.cc/api/v1/jobs \
-H "Authorization: Bearer $LOCLAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "industry": "Plumber", "locations": ["US:TX:Austin"], "limit": 100 }'
# → { "id": "V1StGXR8_Z", "status": "queued" }
# 3. Poll until status is "completed" (or "failed")
curl https://loclay.cc/api/v1/jobs/V1StGXR8_Z -H "Authorization: Bearer $LOCLAY_API_KEY"
# 4. Fetch the leads
curl https://loclay.cc/api/v1/jobs/V1StGXR8_Z/leads -H "Authorization: Bearer $LOCLAY_API_KEY"Authentication
Send your key as a Bearer token in the Authorization header of every request. Keys start with lc_. Create up to 10 in Settings: give each a name and choose when it expires (30 days to 1 year, or never). Settings also shows when each key was last used, and lets you revoke it.
Authorization: Bearer lc_••••••••••••••••••••••••••••••••Credits & limits
One credit is one delivered lead. When a job starts, its full limit is reserved from your credits; when it finishes, whatever it didn’t deliver is refunded. Checking status and fetching leads are free and can be repeated.
| Leads per job | 100, 300, 500, 700, shared across its cities |
|---|---|
| Cities per job | Up to 25 (1 on the free trial) |
| Jobs created | 10 per minute and 20 per 10 minutes, per account |
| Everything else (status, leads, export, lookups) | 120 requests per minute, per account (lookups: per IP). No credit cost |
Pagination
Every endpoint that returns a list (jobs, leads, locations, business types) pages the same way: pass page (from 1) and limit, and the response carries total and totalPages next to the items. A page past the end comes back empty. Export CSV isn’t paged: it’s always the whole file.
{
"jobs": [ … ],
"page": 2,
"limit": 20,
"total": 57,
"totalPages": 3
}Endpoints
Account
/api/v1/accountThe account the key belongs to: its plan and credits. Check credits.remaining before creating a job, since the job’s whole limit is reserved when it starts. plan is null when there’s no active plan; resetsAt is null on the free plan, whose credits are one-time.
curl https://loclay.cc/api/v1/account \
-H "Authorization: Bearer $LOCLAY_API_KEY"{
"email": "you@agency.com",
"plan": { "id": "pro", "name": "Pro" },
"credits": {
"used": 12400,
"limit": 50000,
"remaining": 37600,
"resetsAt": "2026-12-14T00:00:00.000Z"
},
"maxLocationsPerJob": 25
}Create a job
/api/v1/jobsSearches Google Maps for a business type in each city, then reads every business’s website for contacts. Returns at once with the job’s id; the work continues in the background.
Headers
- Idempotency-Keystring
- Any unique string up to 255 characters, e.g. a UUID. Send the same key when retrying after a timeout or network error: if the first request created a job, you get that job back (
200withIdempotent-Replayed: true) instead of a second job and a second charge. Keys are per account and never expire, so use a new one for each new job.
Body
- industrystringrequired
- The business type, as you’d search Google Maps (see Business types for suggestions):
Plumber,Dental clinic,Roofing contractor. - locationsstring[]required
- 1–25 location ids from Locations, all in one country. The job is centred on each city’s coordinates.
- limitnumber
- Total leads across all locations, split evenly between them: one of
100, 300, 500, 700. Default 100. Reserved from your credits up front.
country (two-letter code) and cities ([{ city, state? }]) instead of locations. The job then searches Google Maps for “Plumber in Smalltown, TX”, which is less precise.curl -X POST https://loclay.cc/api/v1/jobs \
-H "Authorization: Bearer $LOCLAY_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{ "industry": "Plumber", "locations": ["US:TX:Austin", "US:TX:Dallas"], "limit": 100 }'{
"id": "V1StGXR8_Z",
"status": "queued"
}List jobs
/api/v1/jobsYour account’s jobs, newest first, including searches started in the app, a page at a time. total and totalPages say how many there are.
Query
- pagenumber
- Which page, from 1. Default 1.
- limitnumber
- Jobs per page, 1–100. Default 20.
curl https://loclay.cc/api/v1/jobs?limit=20 \
-H "Authorization: Bearer $LOCLAY_API_KEY"{
"jobs": [
{
"id": "V1StGXR8_Z",
"status": "completed",
"industry": "Plumber",
"country": "US",
"limit": 100,
"leadsFound": 96,
"creditsCharged": 96,
"createdAt": "2026-11-20T09:12:03.000Z",
"completedAt": "2026-11-20T09:16:41.000Z"
}
],
"page": 1,
"limit": 20,
"total": 1,
"totalPages": 1
}Job status
/api/v1/jobs/{id}A job’s progress, overall and per city. status moves from queued to running to completed.
failed means at least one city failed. The other cities’ leads are still there to fetch, and the failed city’s error says why. Its unused credits are refunded.Path
- idstringrequired
- The id returned when the job was created.
curl https://loclay.cc/api/v1/jobs/V1StGXR8_Z \
-H "Authorization: Bearer $LOCLAY_API_KEY"{
"id": "V1StGXR8_Z",
"status": "running",
"industry": "Plumber",
"country": "US",
"limit": 100,
"leadsFound": 37,
"creditsCharged": 100,
"createdAt": "2026-11-20T09:12:03.000Z",
"completedAt": null,
"cities": [
{ "city": "Austin", "state": "TX", "status": "completed", "leadsFound": 37, "error": null },
{ "city": "Dallas", "state": "TX", "status": "running", "leadsFound": 0, "error": null }
]
}Job leads
/api/v1/jobs/{id}/leadsEvery lead the job found, with every field, in Google Maps order. Missing values are null: nothing is guessed. Safe to call while the job is running to get the leads found so far.
Path
- idstringrequired
- The job's id.
Query
- sortstring
rank(default, Google Maps order),ratingorreviews, highest first.- minRatingnumber
- Only leads rated at least this, e.g. 4.5.
- minReviewsnumber
- Only leads with at least this many reviews.
- ownerEmail1
- Only leads with a decision maker's email.
- noWebsite1
- Only businesses without a website.
- qstring
- Text search over name, category, city and decision maker.
- pagenumber
- Which page, from 1. Default 1.
- limitnumber
- Leads per page, 1–700. Default 100, so a job of up to 100 leads comes back in one page; 700 gets any job in one.
curl https://loclay.cc/api/v1/jobs/V1StGXR8_Z/leads?ownerEmail=1 \
-H "Authorization: Bearer $LOCLAY_API_KEY"{
"id": "V1StGXR8_Z",
"status": "completed",
"leads": [
{
"id": 48213,
"companyName": "Lo Plumbing",
"mapsRank": 3,
"category": "Plumber",
"city": "Austin",
"state": "TX",
"ownerName": "Jane Lo",
"ownerTitle": "Owner",
"ownerEmail": "jane@loplumbing.com",
"businessPhone": "(512) 555-0142",
"website": "https://loplumbing.com",
"rating": 4.8,
"reviews": 212,
"claimed": true,
"linkedin": null
}
],
"page": 1,
"limit": 100,
"total": 1,
"totalPages": 1
}Export CSV
/api/v1/jobs/{id}/exportA job’s leads as a CSV file, the same one the app’s Export button downloads: ready for a spreadsheet, CRM or email tool. Company Name is always the first column. Takes the same filters as Job leads.
Path
- idstringrequired
- The job's id.
Query
- fieldsstring
- Comma-separated field names to include, in table order, e.g.
ownerName,ownerEmail,website. Default: every field. Unknown names are ignored. - sort, minRating, …
- The Job leads filters.
curl "https://loclay.cc/api/v1/jobs/V1StGXR8_Z/export?fields=ownerName,ownerEmail,businessPhone,website" \
-H "Authorization: Bearer $LOCLAY_API_KEY" \
-o leads.csvCompany Name,Decision Maker,Decision Maker Email,Business Phone,Website
Lo Plumbing,Jane Lo,jane@loplumbing.com,(512) 555-0142,https://loplumbing.comLookups
Locations
/api/v1/locationsEvery city a job can run in: 28,000+ cities with 15,000+ people, across 99 countries. Each comes with the id a job takes, which carries its country and the coordinates the job is centred on. Ids like US:TX:Austin are stable, so you can store them.
Query
- qstring
- Filter by city name, case-insensitive. Names starting with it come first.
- countrystring
- Only this country, by two-letter code, e.g.
US. Without it, every country is searched, biggest markets first. - pagenumber
- Which page, from 1. Default 1.
- limitnumber
- Per page, 1–500. Default 20.
curl "https://loclay.cc/api/v1/locations?q=austin&country=US&limit=1"{
"locations": [
{
"id": "US:TX:Austin",
"name": "Austin, TX, United States",
"city": "Austin",
"state": "TX",
"country": "US",
"countryName": "United States",
"lat": 30.2672,
"lng": -97.7431
}
],
"page": 1,
"limit": 1,
"total": 4,
"totalPages": 4
}Business types
/api/v1/business-typesGoogle Maps’ 5,300+ business categories, most common first. They’re suggestions: a job’s industry takes any text, sent to Google Maps as typed.
Query
- qstring
- Filter by name, case-insensitive. Names starting with it come first.
- pagenumber
- Which page, from 1. Default 1.
- limitnumber
- Per page, 1–1000. Default 100.
curl "https://loclay.cc/api/v1/business-types?q=plumb&limit=3"{
"businessTypes": ["Plumber", "Plumbing supply store", "Plumbing"],
"page": 1,
"limit": 3,
"total": 3,
"totalPages": 1
}MCP
MCP server
https://loclay.cc/api/mcpLet an AI assistant run loclay for you: “find 100 plumbers in Austin with an owner’s email and save them as a CSV”. Connect any MCP client that supports remote (Streamable HTTP) servers, signing in with an API key in the Authorization header. The tools are the API’s endpoints, so they use the same credits, limits and data.
| check_credits | Plan and credits left. |
| find_locations | City lookup, returns location ids. |
| find_business_types | Google Maps category suggestions. |
| create_job | Start a lead job. Spends credits. |
| list_jobs | Past jobs, newest first. |
| get_job | A job's status, per city. |
| get_leads | Leads as JSON, with filters and pages. |
| export_leads_csv | Leads as CSV text, to save as a file. |
create_job spends credits. Most clients ask before running a tool that changes anything; loclay also tells the assistant to check credits and confirm a job with you first.claude mcp add --transport http loclay https://loclay.cc/api/mcp \
--header "Authorization: Bearer lc_YOUR_KEY"Prompt for AI tools
Building with an AI assistant? Give it this prompt and it knows the whole API: the flow, every endpoint and field, the limits, and to confirm with you before spending credits. Coding tools use it to write your integration; chat assistants, which can’t call the API with your key, use it to write and explain code for you to run.
Where it goes
- Cursor
- Save the “Cursor rule” tab as
.cursor/rules/loclay.mdcin your project. For running jobs from chat, also add the MCP server. - Claude Code
- Add to your project’s
CLAUDE.md. To run jobs from chat instead of writing code, add the MCP server. - Windsurf
- Save as
.windsurf/rules/loclay.mdin your project. - GitHub Copilot
- Add to
.github/copilot-instructions.mdin your repository. - Claude
- On claude.ai, paste into a Project’s instructions. Claude then writes and explains code that calls the API.
- ChatGPT
- Paste into a Project’s or a custom GPT’s instructions. ChatGPT can’t send your key itself, so it writes the code for you to run.
- Gemini
- Paste into a Gem’s instructions, or at the start of a chat.
- Grok
- Paste into Customize Grok’s instructions, or at the start of a chat.
# loclay API
loclay finds local businesses on Google Maps for a business type in one or more cities, then reads each business's own website for the decision maker (name, title, email, phone), published emails and phones, and social profiles. Every contact comes from a real source; nothing is guessed, and missing values are null.
Base URL: https://loclay.cc/api/v1
Auth: header "Authorization: Bearer <key>". Keys start with lc_ and are created at https://loclay.cc/dashboard/settings. Read the key from an environment variable (LOCLAY_API_KEY); never hard-code it, print it or put it in front-end code.
Full reference: https://loclay.cc/docs/api
## Flow
1. GET /locations?q=<city>&country=<CC> (public, no key) -> pick each city's "id", e.g. "US:TX:Austin".
2. GET /account -> check credits.remaining before creating a job.
3. POST /jobs with JSON {"industry": "Plumber", "locations": ["US:TX:Austin"], "limit": 100} and an "Idempotency-Key: <uuid>" header -> {"id", "status": "queued"}.
4. GET /jobs/{id} every 20-30 seconds until status is "completed" or "failed" (a few minutes). "failed" means at least one city failed; the other cities' leads are still available.
5. GET /jobs/{id}/leads (JSON, paged) or GET /jobs/{id}/export (CSV file).
## Endpoints
- GET /account: plan, credits {used, limit, remaining, resetsAt}, maxLocationsPerJob.
- POST /jobs: industry (string, any Google Maps business type), locations (1-25 ids, all in one country), limit (100, 300, 500 or 700; default 100). Reuse the same Idempotency-Key only when retrying the same request.
- GET /jobs?page=&limit=: past jobs, newest first.
- GET /jobs/{id}: status, leadsFound, and per-city status and error.
- GET /jobs/{id}/leads?page=&limit=: leads (limit up to 700 per page; default 100).
- GET /jobs/{id}/export?fields=ownerName,ownerEmail,website: CSV; Company Name is always the first column; default every field.
- Filters on leads and export: sort=rank|rating|reviews, minRating, minReviews, ownerEmail=1 (has a decision maker's email), noWebsite=1, q (text search).
- GET /business-types?q= (public): Google Maps category suggestions.
- Lists return {page, limit, total, totalPages} next to the items.
## Lead fields
id, companyName, mapsRank, category, city, state, street, zip, ownerName, ownerFirstName, ownerLastName, ownerTitle, ownerEmail, ownerPhone, businessPhone, businessEmail, website, allEmails, allPhones, rating, reviews, claimed (Google Maps listing claimed by its owner), hours, facebook, instagram, linkedin, youtube, tiktok, yelp, logo, image.
## Rules
- Creating a job spends credits: 1 per delivered lead. The whole limit is reserved when the job starts and the unused part is refunded when it ends. Always confirm the industry, cities and limit with me before creating a job.
- Errors are JSON {"error": "..."}: 400 bad input, 401 bad or expired key, 402 no plan or not enough credits, 404 not found, 429 rate limited (wait for the Retry-After seconds, then retry), 503 temporarily unavailable (no credits used; retry).
- Rate limits: 10 job creations a minute per account; 120 other requests a minute.
- Do not invent leads, fields or endpoints. If something isn't covered here, check https://loclay.cc/docs/api.Reference
Lead fields
Each lead has an id and companyName, plus these fields, the same ones as the results table and CSV export.
| Field | Type | Description |
|---|---|---|
| mapsRank | number | Position in this job's Google Maps results, 1 = top (sponsored listings not counted). |
| category | string | Google's category for the business. |
| city | string | City from the Maps listing. |
| state | string | State or region. |
| street | string | Street address. |
| zip | string | Postal code. |
| ownerName | string | Decision maker, only when the business's own site names them in a role, or the business is named after them. |
| ownerFirstName | string | First word of ownerName. |
| ownerLastName | string | The rest of ownerName. |
| ownerTitle | string | Their role as the site states it, e.g. Owner, Founder. |
| ownerEmail | string | Email published next to the decision maker's name. Never pattern-generated. |
| ownerPhone | string | Direct phone published next to their name. |
| businessPhone | string | Phone from the Google Maps listing. |
| businessEmail | string | Main email published on the business's website. |
| website | string | Website from the Maps listing. |
| allEmails | string | Every email found, deduplicated, separated by "; ". |
| allPhones | string | Every phone found, deduplicated, separated by "; ". |
| rating | number | Google rating, 1–5. |
| reviews | number | Google review count. |
| claimed | boolean | Whether the owner has claimed the Maps listing. null on leads saved before it was collected. |
| hours | string | Opening hours, one day per "; "-separated entry. |
| string | Facebook page URL. | |
| string | Instagram profile URL. | |
| string | LinkedIn URL. | |
| youtube | string | YouTube channel URL. |
| tiktok | string | TikTok profile URL. |
| yelp | string | Yelp page URL. |
| logo | string | Logo image URL. |
| image | string | Main photo URL from the Maps listing. |
Errors
Errors use standard HTTP status codes, with a JSON body whose error is a sentence you can show to a person.
- 400 Bad request
- Invalid JSON, no business type, a limit other than 100, 300, 500 or 700, an unknown location id, locations in more than one country, or more than 25.
- 401 Unauthorized
- The API key is missing, malformed, revoked or expired.
- 402 Payment required
- No active plan, or not enough credits for the job's limit.
- 404 Not found
- No job with that id on your account.
- 429 Too many requests
- Over a rate limit (see Credits & limits). Wait for the Retry-After seconds, then retry.
- 503 Unavailable
- The crawler is down or the job couldn't be queued. No credits were used; retry.
{
"error": "Not enough credits left for this limit."
}