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&user_id=123&query=marketing+agency+new+york&se=google"

Authentication

Every API request requires two parameters:

ParameterTypeDescription
api_key Required string Your Softsale license key. Found in your account dashboard under "API Key".
user_id Required integer Your aMember user ID. Found in your account profile.

Both parameters are sent as query string parameters on every request:

GET /api/v1/search.php?api_key=YOUR_KEY&user_id=123&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 missing_user_id The user_id parameter was not provided.
400 invalid_user_id The user_id must be a positive integer.
401 invalid_api_key API key is invalid, expired, or not recognized.
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.
user_id Required integer Your user ID.
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&\
user_id=123&\
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.
user_id Required integer Your user ID.
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&\
user_id=123&\
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.
user_id Required integer Your user ID.
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&\
user_id=123&\
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.

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

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

Changelog

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.