Integration guide

LeadMerlin + Cursor

Project rule (markdown file)

Cursor’s agent follows project rules stored as files in your repo. Saving the LeadMerlin skill as a rule gives the agent the endpoints and workflow it needs to fetch leads on request.

Before you start

Setup

  1. 1

    Set the API key

    Export LEADMERLIN_API_KEY in the shell Cursor’s terminal uses, or add it to a local .env file that is git-ignored.

    export LEADMERLIN_API_KEY="lm_your_key"
  2. 2

    Add the skill as a rule

    Create a rule file (for example .cursor/rules/leadmerlin.mdc) and paste the skill text from the LeadMerlin docs, plus the auth note below.

    <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

    Ask the agent

    In agent mode, reference the rule or just describe the task.

    Using the LeadMerlin rule, find med spas in Scottsdale and Phoenix,
    then save name, owner, best email and phone type to medspa-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.