LeadGen.tools API

Programmatic access to lead generation, web scraping, ad intelligence, and Google Places data. Integrate our tools directly into your applications and workflows.

https://leadgen.tools/v2/api/v1/

Introduction

The LeadGen.tools REST API lets you search for leads, crawl websites for contact information, monitor competitor ads, and query Google Places — all from simple HTTP GET requests.

Every request is authenticated with your API key and user ID. Operations consume credits from your account balance, and responses are automatically cached to save credits on repeated queries.

Quick Start

Make your first API call in seconds:

Example Request
curl "https://leadgen.tools/v2/api/v1/search.php?api_key=YOUR_KEY&query=marketing+agency+new+york&se=google"

Authentication

Every API request requires your API key:

ParameterTypeDescription
api_key Required string Your Softsale license key. Found in your account dashboard under "API Key". Your user account is automatically resolved from the key.

The API key is sent as a query string parameter on every request:

GET /api/v1/search.php?api_key=YOUR_KEY&query=...

Keep your API key secret

Never expose your API key in client-side code, public repositories, or shared URLs. Treat it like a password.

Base URL

All API endpoints are accessed under:

https://leadgen.tools/v2/api/v1/

For example, the full URL for the Lead Search endpoint is:

https://leadgen.tools/v2/api/v1/search.php

Response Format

All responses are returned as JSON with the Content-Type: application/json; charset=utf-8 header.

Success Response

{
  "status": "success",
  "credits_used": 10,
  "data": {
    // endpoint-specific data
  }
}

Error Response

{
  "status": "error",
  "code": "error_code",
  "message": "Human-readable description of the error."
}

The credits_used field tells you how many credits were deducted for that request. A value of 0 means the response was served from cache or no billable results were returned.

Error Handling

Errors return an appropriate HTTP status code along with a JSON body containing a machine-readable code and a human-readable message.

HTTP StatusError CodeDescription
400 missing_param A required parameter is missing from the request.
400 invalid_param A parameter value is invalid (e.g. unsupported search engine).
400 invalid_code Recipe code not found or invalid (search endpoint only).
401 missing_api_key The api_key parameter was not provided.
401 invalid_api_key API key is invalid, expired, or user could not be resolved.
402 insufficient_credits Your account has no credits remaining. Purchase more to continue.
500 db_error Internal database connection error.
502 search_error The upstream search request failed. Retry after a few seconds.
502 crawl_error Could not fetch the provided URL.
502 api_error Upstream Google API error (Places endpoints).
503 auth_error License verification service unavailable. Retry later.

Tip: Credits are never deducted when an error occurs. You are only charged for successful operations that return data.

Credit System

Each API operation costs credits, which are deducted from your account balance. The exact cost depends on the endpoint and the results returned.

EndpointCreditsDetails
Lead Search 0 – 10 10 credits if >7 results returned. Otherwise, 1 credit per email found in the SERP. 0 if no results.
Website Crawler 0 – 15 1 credit per unique valid email found. Minimum 1 credit if any data (emails, phones, or social links) is returned. 0 if nothing found.
Ad Spy 0 – 10 10 credits if >7 fresh ads returned. Otherwise, 1 credit per ad containing an email. Crawl enrichment and historical ads are free.
Places Search 0 – 200 10 credits per place detail lookup (cache miss). 0 credits for cached places. Up to 20 places per page.
Place Reviews 0 or 5 5 credits on cache miss (fresh Google API call). 0 credits if reviews are cached within 7 days.

Cache hits are free. When a response is served from cache, credits_used will be 0. Caching is automatic — repeated identical queries save you credits.

Caching

Responses are automatically cached to reduce latency and save credits. If an identical request has been made recently, the cached response is returned instantly with credits_used: 0.

EndpointCache TTLNotes
Lead Search 7 days Same query + search engine + page + results_per_page
Website Crawler 14 days Same domain URL
Ad Spy Permanent Individual ads stored permanently. Crawl data refreshed every 7 days. Each request always performs a fresh search.
Places Search 30 days Per-place cache based on place_id
Place Reviews 7 days Per-place cache based on place_id

Rate Limits

There are currently no hard rate limits enforced per-minute. However, some endpoints involve upstream API calls (ScraperAPI, Google Places) that may take several seconds to complete. Recommendations:

  • Keep concurrent requests reasonable (under 5 simultaneous).
  • Use the caching system — avoid polling the same query repeatedly.
  • The crawler endpoint can take up to 2 minutes for deep crawls (up to 15 pages). Set your HTTP client timeout accordingly.
  • Ad Spy with crawl enrichment may take 30–60 seconds on first call (crawling up to 15 ad landing pages).

Website Crawler

GET /api/v1/crawl.php

Crawl a website to extract emails, phone numbers, social media links, and page metadata. Automatically follows internal links and crawls up to 15 pages for thorough data extraction.

★ 0 – 15 credits

Parameters

ParameterTypeDefaultDescription
api_key Required string Your API key.
domain Required string The URL to crawl. If no protocol is provided, https:// is prepended automatically. Example: example.com or https://example.com

Example Request

curl "https://leadgen.tools/v2/api/v1/crawl.php?\
api_key=YOUR_KEY&\
domain=example.com"

Example Response

{
  "status": "success",
  "credits_used": 3,
  "data": {
    "domain": "https://example.com",
    "pages_crawled": 8,
    "metadata": {
      "title": "Example Company — Home",
      "description": "We provide enterprise solutions for...",
      "keywords": "enterprise, solutions, consulting",
      "image": "https://example.com/og-image.jpg"
    },
    "emails": [
      "contact@example.com",
      "sales@example.com",
      "hr@example.com"
    ],
    "all_emails": [
      "contact@example.com",
      "sales@example.com",
      "hr@example.com",
      "support@otherdomain.com"
    ],
    "phones": [
      "(555) 123-4567",
      "(555) 987-6543"
    ],
    "social_links": [
      "https://twitter.com/example",
      "https://www.linkedin.com/company/example",
      "https://www.facebook.com/example"
    ]
  }
}

Response Fields

FieldTypeDescription
domainstringThe normalized URL that was crawled.
pages_crawledintegerTotal number of pages crawled (max 15).
metadataobjectPage metadata: title, description, keywords, and image (Open Graph).
emailsstring[]Valid emails matching the crawled domain only.
all_emailsstring[]All emails found, including those from other domains.
phonesstring[]Phone numbers extracted from all crawled pages.
social_linksstring[]Social media profile URLs (Facebook, Twitter/X, LinkedIn, Instagram, YouTube, TikTok, Pinterest, Snapchat, Telegram, WhatsApp, Spotify).

Credit Calculation

  • 1 credit per unique domain-matched email found
  • Minimum 1 credit if any data (emails, phones, or social links) is returned
  • No data found → 0 credits
  • Cache hit → 0 credits

How the Crawler Works

  1. Fetches the main page at the provided URL.
  2. Extracts emails, phones, social links, and metadata from the HTML.
  3. Discovers internal links on the page.
  4. Crawls up to 14 additional internal pages (15 total max).
  5. Merges and deduplicates all results.

Email filtering: Junk emails are automatically excluded — website builders (wix, squarespace), placeholder domains (example.com, yourname.com), generic local parts (admin, noreply, test), and image file extensions.

Ad Spy

GET /api/v1/ads.php

Search for Google and Bing ads, automatically accumulate historical results, and enrich each ad with contact data by crawling the landing page. Every search adds newly discovered ads to a permanent database, so repeated queries return both fresh ads (currently running) and historical ads (previously seen).

★ 0 – 10 credits

Parameters

ParameterTypeDefaultDescription
api_key Required string Your API key.
query Required string The ad search query (e.g. marketing agency).
se Optional string google Search engine. One of: google, bing
page Optional integer 0 Pagination offset for the live SERP search.
include_history Optional boolean true Include historical ads from previous searches. Set to false to only return fresh ads from this search.

Example Request

curl "https://leadgen.tools/v2/api/v1/ads.php?\
api_key=YOUR_KEY&\
query=marketing+agency&\
se=google&\
include_history=true"

Example Response

{
  "status": "success",
  "credits_used": 10,
  "data": {
    "query": "marketing agency",
    "search_engine": "google",
    "page": 0,
    "fresh_count": 5,
    "historical_count": 3,
    "results_count": 8,
    "results": [
      {
        "position": 1,
        "title": "Best Marketing Agency | Award-Winning",
        "url": "https://www.exampleagency.com/",
        "ad_text": "Full-service digital marketing agency. Get a free audit today...",
        "search_engine": "google",
        "first_seen": "2025-01-15 10:00:00",
        "last_seen": "2026-02-15 14:30:00",
        "is_active": true,
        "contact_data": {
          "emails": ["info@exampleagency.com"],
          "phones": ["(555) 123-4567"],
          "social_links": [
            "https://facebook.com/exampleagency",
            "https://linkedin.com/company/exampleagency"
          ],
          "metadata": {
            "title": "Example Agency — Digital Marketing",
            "description": "Award-winning agency specializing in SEO, PPC, and social media.",
            "keywords": "marketing, agency, SEO, PPC",
            "image": "https://www.exampleagency.com/og-image.png"
          }
        }
      },
      {
        "position": 3,
        "title": "Grow Your Business | Old Ad Agency",
        "url": "https://www.oldagency.com/",
        "ad_text": "We help businesses scale with proven strategies...",
        "search_engine": "google",
        "first_seen": "2024-11-02 08:15:00",
        "last_seen": "2025-12-20 11:00:00",
        "is_active": false,
        "contact_data": {
          "emails": ["hello@oldagency.com"],
          "phones": [],
          "social_links": ["https://twitter.com/oldagency"],
          "metadata": {
            "title": "Old Agency",
            "description": "",
            "keywords": "",
            "image": ""
          }
        }
      }
    ]
  }
}

Response Fields

FieldTypeDescription
fresh_countintegerNumber of ads found in the current live search.
historical_countintegerNumber of additional ads from previous searches.
results_countintegerTotal number of results (fresh + historical, deduplicated).
results[].positionintegerAd position on the SERP.
results[].first_seendatetimeWhen this ad was first discovered.
results[].last_seendatetimeWhen this ad was last seen in a live search.
results[].is_activebooleantrue if the ad appeared in the current search, false if it's historical only.
results[].contact_dataobjectContact information extracted from crawling the ad's landing page. Contains emails, phones, social_links, and metadata.

How It Works

  1. Fresh search — Performs a live Google/Bing search to find currently running ads.
  2. Store — Each fresh ad is saved to a permanent database. New ads are inserted; existing ads have their last_seen timestamp updated.
  3. Load history — All previously stored ads for the same query are loaded and merged.
  4. Crawl enrichment — Each ad's landing page URL is crawled to extract emails, phones, social links, and page metadata. Up to 15 ads are crawled per request. Crawl results are cached for 7 days.
  5. Return — Results are returned sorted by last_seen (most recent first), with is_active indicating whether each ad appeared in the current live search.

Historical accumulation: Every time you search the same query, newly discovered ads are added to the pool. Over time, you build a comprehensive database of all ads that have ever run for that keyword. Use first_seen and last_seen to track ad lifespan.

Credit Calculation

  • Credits are based on fresh results only (historical and crawl enrichment are free).
  • More than 7 fresh ads → 10 credits
  • 7 or fewer fresh ads → 1 credit per ad containing an email
  • No fresh ads → 0 credits (but historical results are still returned)

Place Reviews

GET /api/v1/places/reviews.php

Fetch Google reviews for a specific place. Use the place_id from the Places Search response. Reviews are cached for 7 days.

★ 0 or 5 credits

Parameters

ParameterTypeDefaultDescription
api_key Required string Your API key.
place_id Required string Google Place ID (e.g. ChIJr3_gqu5ZwokR...). Obtained from the Places Search endpoint.

Example Request

curl "https://leadgen.tools/v2/api/v1/places/reviews.php?\
api_key=YOUR_KEY&\
place_id=ChIJr3_gqu5ZwokR..."

Example Response

{
  "status": "success",
  "credits_used": 5,
  "data": {
    "place_id": "ChIJr3_gqu5ZwokR...",
    "reviews": [
      {
        "author_name": "John D.",
        "author_url": "https://www.google.com/maps/contrib/...",
        "language": "en",
        "rating": 5,
        "text": "Best pizza in NYC. Been coming here for 20 years!",
        "time": 1705330200,
        "relative_time_description": "a month ago",
        "profile_photo_url": "https://lh3.googleusercontent.com/..."
      }
    ],
    "cached": false
  }
}

Response Fields

FieldTypeDescription
reviewsobject[]Array of review objects from Google. Up to 5 most relevant reviews (Google API limit).
reviews[].author_namestringReviewer's display name.
reviews[].ratingintegerReview rating (1 – 5).
reviews[].textstringReview text content.
reviews[].timeintegerUnix timestamp of when the review was posted.
cachedbooleantrue if served from cache (0 credits), false if freshly fetched (5 credits).

Credit Calculation

  • 5 credits for a fresh Google API call (cache miss).
  • 0 credits if reviews are cached (within 7 days).
  • If the Google API returns an error, 0 credits are deducted and an error response is returned.

Projects

GET POST /api/v1/projects.php

Create and list projects. Projects are containers for leads and campaigns.

★ 0 credits

GET — List Projects

ParameterTypeDefaultDescription
search OptionalstringFilter projects by name (partial match).

Example Response

{
  "status": "success",
  "credits_used": 0,
  "data": {
    "projects_count": 2,
    "projects": [
      {
        "id": 42,
        "name": "NYC Agencies",
        "type": "",
        "campaigns": [
          {"id": 8, "name": "Cold Outreach", "status": "active"}
        ]
      }
    ]
  }
}

POST — Create Project

Body FieldTypeRequiredDescription
namestringRequiredProject name. Must be unique per user.

Example

curl -X POST "https://leadgen.tools/v2/api/v1/projects.php?api_key=KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "NYC Marketing Agencies"}'

Leads

GET POST /api/v1/leads.php

List and import leads into projects. Leads are the contacts that campaigns send emails to.

★ 0 credits

GET — List Leads

ParameterTypeDefaultDescription
project_id RequiredintegerProject ID to list leads from.
limit Optionalinteger100Max leads to return (1–500).
offset Optionalinteger0Pagination offset.

POST — Add Leads

Body FieldTypeRequiredDescription
project_idintegerRequiredTarget project ID.
leadsobject[]RequiredArray of lead objects (max 500). Each must have email.

Lead Object Fields

FieldTypeRequiredDescription
emailstringRequiredEmail address.
firstnamestringOptionalAuto-extracted from email if not provided.
lastnamestringOptionalAuto-extracted from email if not provided.
companystringOptionalCompany name.
websitestringOptionalCompany website URL.
phonesstringOptionalPhone number(s).
descriptionstringOptionalDescription or notes.

Example

curl -X POST "https://leadgen.tools/v2/api/v1/leads.php?api_key=KEY" \
  -H "Content-Type: application/json" \
  -d '{"project_id": 42, "leads": [{"email": "john@example.com", "firstname": "John"}]}'

Deduplication: Leads with the same email within a project are automatically skipped. The duplicates count tells you how many were skipped.

Email Verification

POST /api/v1/verify.php

Verify email addresses for deliverability. Checks domain, MX records, SPF, DKIM, DMARC, disposable email blocklist, and SMTP mailbox existence. Optionally updates lead records.

★ 0 credits
Body FieldTypeRequiredDescription
emailsstring[]RequiredArray of email addresses (max 20).
lead_idsinteger[]OptionalMatching lead IDs. Valid → verified=1, invalid → verified=-1.

Example

curl -X POST "https://leadgen.tools/v2/api/v1/verify.php?api_key=KEY" \
  -H "Content-Type: application/json" \
  -d '{"emails": ["john@example.com", "bad@fake.xyz"], "lead_ids": [1234, 1235]}'

Rate limit: Max 20 emails per request. SMTP validation takes 2–5 seconds per email.

Sending Accounts

GET /api/v1/accounts.php

List connected sending accounts (Gmail OAuth and SMTP). These are used as sending_accounts when creating campaigns.

★ 0 credits
ParameterTypeDefaultDescription
type OptionalstringFilter by gmail or smtp.

Account setup: Gmail accounts are connected via OAuth on the platform. SMTP accounts are configured in the SMTP Settings page. The API only reads accounts — it cannot create or modify them.

Campaigns

GET POST /api/v1/campaigns.php

Create and list email campaigns. Campaigns are linked to a project (lead source) and one or more sending accounts.

★ 0 credits

GET — List Campaigns

Returns all campaigns for the authenticated user with summary stats.

GET — Campaign Detail (?id=X)

Returns full campaign with steps, recipient stats, and sending accounts.

POST — Create Campaign

Body FieldTypeRequiredDescription
namestringRequiredCampaign name.
project_idintegerRequiredProject to pull leads from.
sending_accountsobject[]RequiredArray of {"type": "gmail|smtp", "id": N} objects.
stepsobject[]RequiredEmail sequence steps (from AI generator or manual).
daily_limitintegerOptionalMax emails/day (default 50).
batch_sizeintegerOptionalEmails per cron run (default 5).

Campaigns are created in draft status. Use the Launch endpoint to activate sending.

AI Email Generation

POST /api/v1/campaigns/generate.php

Generate a complete email sequence using AI (GPT-4o-mini). Returns spintax-powered subject lines and HTML bodies with merge fields. Pass the generated steps directly to the Create Campaign or Update Steps endpoint.

★ 1 credit per email (min 2, max 10)
Body FieldTypeRequiredDescription
promptstringRequiredCampaign description for the AI.
num_followupsintegerOptionalNumber of follow-ups (1–5, default 2).
custom_system_promptstringOptionalOverride system prompt.
custom_user_prompt_templatestringOptionalOverride user prompt template ({num_followups} and {prompt} placeholders).

Update Campaign Steps

PUT /api/v1/campaigns/steps.php

Replace all steps of a draft or paused campaign.

★ 0 credits
Body FieldTypeRequiredDescription
campaign_idintegerRequiredCampaign to update.
stepsobject[]RequiredNew email steps array.

Launch Campaign

POST /api/v1/campaigns/launch.php

Launch a draft campaign. Validates steps and sending accounts, populates recipients from project leads, and sets status to active. Emails are sent by the server cron every 5 minutes (1 credit per email).

★ 0 credits (emails cost 1 each when sent by cron)
Body FieldTypeRequiredDescription
campaign_idintegerRequiredDraft campaign to launch.

Campaign Control

POST /api/v1/campaigns/control.php

Pause, resume, or cancel an active campaign.

★ 0 credits
Body FieldTypeRequiredDescription
campaign_idintegerRequiredCampaign to control.
actionstringRequiredOne of: pause, resume, cancel.

State Transitions

ActionFromTo
pauseactivepaused
resumepausedactive
cancelactive / pausedcancelled

Campaign Status

GET /api/v1/campaigns/status.php

Lightweight endpoint for polling campaign progress. Returns campaign stats and per-status recipient counts.

★ 0 credits
ParameterTypeRequiredDescription
campaign_id RequiredintegerCampaign ID to check.

Polling: Check every 60 seconds while campaign is active. Campaign is done when pending + in_progress = 0 in recipient_stats.

Campaign Recipients

GET /api/v1/campaigns/recipients.php

List recipients for a campaign with optional status filtering. Use ?status=replied to see who has responded.

★ 0 credits
ParameterTypeDefaultDescription
campaign_id RequiredintegerCampaign ID.
status OptionalstringFilter: pending, in_progress, completed, replied, bounced, unsubscribed.
limit Optionalinteger100Max results (1–500).
offset Optionalinteger0Pagination offset.

Quick Reference

All endpoints at a glance:

Lead Search

Search engines for leads with email & phone extraction.

GET /api/v1/search.php

Website Crawler

Deep-crawl a website for contact data & social links.

GET /api/v1/crawl.php

Ad Spy

Monitor ads with historical tracking & crawl enrichment.

GET /api/v1/ads.php

Places Search

Google Places business listings with full details.

GET /api/v1/places/search.php

Place Reviews

Fetch Google reviews for any place by ID.

GET /api/v1/places/reviews.php

Projects

Create and list lead projects.

GET POST /api/v1/projects.php

Leads

Import and list leads in projects.

GET POST /api/v1/leads.php

Email Verification

Verify email deliverability (SMTP, DNS, disposable).

POST /api/v1/verify.php

Sending Accounts

List Gmail & SMTP sending accounts.

GET /api/v1/accounts.php

Campaigns

Create, list, and manage email campaigns.

GET POST /api/v1/campaigns.php

AI Email Generation

Generate spintax email sequences with AI.

POST /api/v1/campaigns/generate.php

Credit Summary

EndpointMethodPathCreditsCache TTL
Lead SearchGET/api/v1/search.php0 – 107 days
Website CrawlerGET/api/v1/crawl.php0 – 1514 days
Ad SpyGET/api/v1/ads.php0 – 10Permanent (ads) / 7d (crawl)
Places SearchGET/api/v1/places/search.php0 – 20030 days
Place ReviewsGET/api/v1/places/reviews.php0 or 57 days
ProjectsGET POST/api/v1/projects.php0
LeadsGET POST/api/v1/leads.php0
Email VerificationPOST/api/v1/verify.php0
Sending AccountsGET/api/v1/accounts.php0
CampaignsGET POST/api/v1/campaigns.php0
AI Email GenerationPOST/api/v1/campaigns/generate.php1 per email (min 2)
Update StepsPUT/api/v1/campaigns/steps.php0
Launch CampaignPOST/api/v1/campaigns/launch.php0
Campaign ControlPOST/api/v1/campaigns/control.php0
Campaign StatusGET/api/v1/campaigns/status.php0
Campaign RecipientsGET/api/v1/campaigns/recipients.php0

Changelog

v1.3 — February 2026

  • Campaign Management API (OpenClaw): Full campaign lifecycle via API — create projects, import leads, verify emails, generate AI email sequences, create & launch campaigns, and monitor progress.
  • New endpoints: Projects, Leads, Email Verification, Sending Accounts, Campaigns, AI Email Generation, Update Steps, Launch, Control, Status, Recipients.
  • AI Email Generation: Generate spintax-powered email sequences with GPT-4o-mini. 1 credit per email generated.
  • Email Verification: Domain, MX, SPF, DKIM, DMARC, disposable check, and SMTP deliverability validation.

v1.2 — February 2026

  • Ad Spy — Historical ads: Ads are now stored permanently. Every search adds new ads to a historical database. Use first_seen, last_seen, and is_active to track ad lifespan and activity.
  • Ad Spy — Crawl enrichment: Each ad's landing page is automatically crawled for emails, phones, social_links, and page metadata. Data is returned in the contact_data object on each result.
  • Extended caching: Search cache increased from 1 hour to 7 days. Crawl cache increased from 24 hours to 14 days.
  • New parameter: include_history on Ad Spy endpoint to control whether historical ads are included.

v1.1 — January 2026

  • Places Search: Added Google Places Search endpoint with automatic caching.
  • Place Reviews: Added Google Place Reviews endpoint with 7-day cache.

v1.0 — December 2025

  • Initial release with Lead Search, Website Crawler, and Ad Spy endpoints.
  • Softsale license key authentication.
  • Credit-based billing with automatic caching.