Integration guide

LeadMerlin + Claude Code

Agent skill (markdown file)

Claude Code can load skills from markdown files in your project. Add the LeadMerlin skill once and Claude can search Google Maps, enrich every business and write a CSV whenever you ask for leads.

Before you start

Setup

  1. 1

    Store your API key in the environment

    Add the key to your shell profile so it never ends up in your repo.

    echo 'export LEADMERLIN_API_KEY="lm_your_key"' >> ~/.zshrc
    source ~/.zshrc
  2. 2

    Create the skill file

    Create .claude/skills/leadmerlin/SKILL.md. Start it with this frontmatter so Claude knows when to use it, then paste the skill text from the docs page (Docs → Agent Skill → Copy skill) below it.

    ---
    name: leadmerlin
    description: Search local businesses by niche and city with the LeadMerlin API, enrich them (owner names, verified emails, phone line types, tech stack) and export CSV. Use for lead generation and prospect lists.
    ---
    
    <paste the LeadMerlin skill from leadmerlin.com/docs here>
    
    ## Auth
    Read the API key from the LEADMERLIN_API_KEY environment variable and send it
    as the x-api-key header. Never write the key into files or code.
  3. 3

    Test on demo data first

    Ask Claude to run the workflow against the demo endpoints. They need no key and cost nothing.

    > Use the leadmerlin skill against the demo endpoints and show me the first 3 results.
  4. 4

    Run a real search

    Ask for what you want in plain English. Claude resolves the city, starts the job, polls it and pages through results.

    > Find roofing contractors in Tampa, keep only leads with a verified email,
    > and export them to roofers-tampa-leads.csv

Location codes in these examples are placeholders — always look yours up with GET /v2/locations first.

Tips

API at a glance

CallWhat it does
GET /v2/locations?q=City name → location_code (free)
GET /v2/suggest?niche=Vague niche → Google categories + sharper keywords (free)
POST /v2/searchesStart a search job: keyword, 1–5 location_codes, optional strictness
POST /v2/enrichmentsEnrich up to 100 domains you already have
GET /v2/jobs/:idPoll until status is completed
GET /v2/jobs/:id/resultsPaginated enriched businesses (cursor, limit ≤ 200)
/v2/demo/*Same shapes on fixture data — no key, no credits

All calls use the x-api-key header except the demo endpoints. Base URL: https://api.leadmerlin.com/api

Related

Get your API key.

Sign up free to get an lm_ key and 100 enriched leads. No credit card.