Facebook Ad Library search in n8n with one HTTP Request node (LurkAPI)

I built LurkAPI, a social media data API, so this is my own tool. I’m sharing it here because pulling it into n8n takes one HTTP Request node, no community node needed. This example searches Meta’s Ad Library for live ads on a keyword and splits the result into one item per ad, ready for Google Sheets, Airtable or an AI Agent node.

1. Credential

Sign up at the link below (100 free credits, no card) and copy an API key from the dashboard. In n8n, create a Header Auth credential:

  • Name: x-api-key
  • Value: your key (lk_live_...)

2. HTTP Request node

  • Method: GET
  • URL: https://api.lurkapi.com/v1/facebook/adLibrary/search/ads
  • Authentication: Generic Credential Type → Header Auth → the credential above
  • Send Query Parameters: on, Using Fields Below
    • query = running shoes
    • country = US
    • status = active

Then a Split Out node with Fields To Split Out = searchResults.

Or paste both nodes onto the canvas and pick your credential:

3. What comes back

The HTTP Request node returns one item. Trimmed to one ad and a few of its fields, it looks like this:

{
  "success": true,
  "credits_remaining": 999,
  "credits_charged": 1,
  "searchResultsCount": 37660,
  "searchResults": [
    {
      "ad_archive_id": "1279489107485101",
      "page_name": "HOKA",
      "is_active": true,
      "publisher_platform": ["FACEBOOK", "INSTAGRAM"],
      "start_date": 1775026800,
      "snapshot": {
        "title": "FLY HUMAN FLY™",
        "body": { "text": "The legs give out. The heart doesn’t. Together We Fly Higher." },
        "cta_text": "Learn more",
        "display_format": "IMAGE",
        "link_url": "https://www.hoka.com/en/us/fly-human-fly/?utm_source=facebookinstagram&..."
      }
    }
  ],
  "cursor": "AQHTNrjEvTw_VUW75_..."
}

After Split Out, map page_name, snapshot.body.text and snapshot.link_url into your sheet. start_date is a Unix timestamp: {{ DateTime.fromSeconds($json.start_date).toISODate() }} gives a date.

4. More pages

The first page has up to 30 ads, and cursor gets the next (later pages have up to 10). In the HTTP Request node, Options → Add option → Pagination:

  • Pagination Mode: Update a Parameter in Each Request
  • Type: Query, Name: cursor, Value: {{ $response.body.cursor }}
  • Pagination Complete When: Other, Complete Expression: {{ !$response.body.cursor }}
  • Limit Pages Fetched: on, with a Max Pages you’re happy to pay for

Cost and other endpoints

Each call (each page) costs 1 credit; packs start at $9 for 10,000 credits and never expire. Calls with bad parameters, rate-limited calls and 5xx errors are free. The same node works for the other endpoints by changing the URL and query: /v1/tiktok/profile?handle=nike, /v1/reddit/search?query=..., /v1/youtube/video/transcript?url=..., and Google’s and LinkedIn’s ad libraries. It reads public data only.

https://lurkapi.com · Docs for this endpoint: Search Ad Library ads API (Facebook) | LurkAPI

Questions welcome, and I’d like to hear what you’d build with it.