Integration guide

LeadMerlin + n8n

Generic HTTP Request node — not an official n8n node

There is no dedicated LeadMerlin node yet. Use n8n’s built-in HTTP Request node with header authentication — the workflow is four nodes plus a loop.

Before you start

Setup

  1. 1

    Create a Header Auth credential

    In Credentials, add "Header Auth" with name x-api-key and your key as the value. Reuse it on every HTTP Request node.

  2. 2

    HTTP Request — start the search

    Method POST, URL below, body type JSON. Map keyword and location code from your trigger (form, sheet row, schedule).

    POST https://api.leadmerlin.com/api/v2/searches
    {
      "keyword": "{{ $json.keyword }}",
      "location_codes": [{{ $json.location_code }}]
    }
  3. 3

    Wait, then poll

    Add a Wait node (for example 30 seconds), then an HTTP Request node that GETs the job. Add an IF node: if status is not "completed", loop back to the Wait node.

    GET https://api.leadmerlin.com/api/v2/jobs/{{ $('Start search').item.json.job_id }}
  4. 4

    Fetch results with pagination

    GET the results URL with limit=200. In the node’s Pagination options, update the cursor query parameter from the previous response and stop when has_more is false.

    GET https://api.leadmerlin.com/api/v2/jobs/<job_id>/results?limit=200
    cursor = {{ $response.body.next_cursor }}
    stop when: {{ $response.body.has_more === false }}
  5. 5

    Split and route

    Split Out the businesses array, filter (for example email present and phone_type = mobile), then send to Google Sheets, HubSpot or your sequencer.

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.