DEV Community

slurpsyrup
slurpsyrup

Posted on

Pull YouTube transcripts, Meta ads and TikTok stats into Claude Code, Cursor and n8n

Out of the box, an agent can't browse the Meta Ad Library or watch a YouTube video. If you ask it what ads a brand is running or what a video says, you get a guess. What you want is a URL that returns JSON, with no scraper to maintain.

This post shows how to wire that up for YouTube transcripts, Meta Ad Library ads, and TikTok and Instagram profile stats. It works from the shell, from an MCP client such as Claude Code or Cursor, and from n8n. You don't run a browser or a proxy on your side. You need one API key.

I work on the API I'm using here, Fetchproof, so weigh my opinions accordingly. The code is all plain HTTP, though, and the same pattern should work against any API you prefer.

Get a key

Sign up at fetchproof.com. New accounts get 100 free credits with no card. Most calls cost 1 credit. The key goes in an x-api-key header, and keys start with fp_.

export FETCHPROOF_API_KEY=fp_your_key
Enter fullscreen mode Exit fullscreen mode

1. A YouTube transcript

curl -s "https://api.fetchproof.com/v1/youtube/video/transcript?url=https://www.youtube.com/watch?v=dQw4w9WgXcQ&language=en" \
  -H "x-api-key: $FETCHPROOF_API_KEY" | jq -r '.transcript_only_text'
Enter fullscreen mode Exit fullscreen mode

The response also has a transcript array with text, startMs and startTimeText per segment (trimmed from the API reference example):

{
  "success": true,
  "credits_charged": 1,
  "videoId": "dQw4w9WgXcQ",
  "transcript": [
    { "text": "♪ We're no strangers to love ♪", "startMs": "18640", "endMs": "21880", "startTimeText": "0:18" }
  ],
  "language": "en"
}
Enter fullscreen mode Exit fullscreen mode

A video with no transcript costs 0 credits, so looping over a channel's uploads doesn't bill you for the gaps.

2. Ads from the Meta Ad Library

curl -s "https://api.fetchproof.com/v1/facebook/adLibrary/company/ads?companyName=Nike&country=US&status=ACTIVE" \
  -H "x-api-key: $FETCHPROOF_API_KEY" | jq '.results | length'
Enter fullscreen mode Exit fullscreen mode

Each ad in results has the page name, start date, platforms, and a snapshot with the body text, CTA, link and creative. If a name matches the wrong page, find the exact page with GET /v1/facebook/adLibrary/search/companies?query=... and pass pageId instead of companyName. Pagination uses a cursor field.

The thing I look at first is how long an ad has been running. Brands turn off ads that lose money, so an ad that's been live for three months is probably working. Sorting by that is more useful than any engagement number the library shows.

3. TikTok and Instagram profile stats

curl -s "https://api.fetchproof.com/v1/tiktok/profile?handle=nasa" -H "x-api-key: $FETCHPROOF_API_KEY" | jq '.stats'
curl -s "https://api.fetchproof.com/v1/instagram/profile?handle=natgeo" -H "x-api-key: $FETCHPROOF_API_KEY" | jq '.data.user | {full_name, followers: .edge_followed_by.count}'
Enter fullscreen mode Exit fullscreen mode

TikTok's stats has followerCount, heartCount and videoCount. Instagram's profile comes back in the shape Instagram's own web app uses, so followers are under edge_followed_by.count.

Two limits you should know about before you build on this:

  • Instagram doesn't expose likes or view counts to signed-out visitors. GET /v2/instagram/user/posts gives you the latest 12 posts with captions, dates and format, which is enough for a cadence audit but not for engagement rates.
  • TikTok keyword search (/v1/tiktok/search/keyword) accepts date_posted, sort_by and region but ignores them. Filter on the create_time_utc field yourself.

Using it from Claude Code or Cursor

The same endpoints are available as MCP tools. The names come from the URL paths: youtube_video_transcript, facebook_adLibrary_company_ads, tiktok_profile, instagram_profile and one per published operation.

Claude Code:

claude mcp add fetchproof -e FETCHPROOF_API_KEY=fp_your_key -- npx -y @fetchproof/mcp
Enter fullscreen mode Exit fullscreen mode

Cursor (.cursor/mcp.json) or Claude Desktop (claude_desktop_config.json):

{
  "mcpServers": {
    "fetchproof": {
      "command": "npx",
      "args": ["-y", "@fetchproof/mcp"],
      "env": { "FETCHPROOF_API_KEY": "fp_your_key" }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

There's also a hosted endpoint at https://api.fetchproof.com/mcp for clients that speak streamable HTTP. Send the key as x-api-key or Authorization: Bearer.

With that in place you can write "get the transcript for this video and list the claims it makes" or "what has Nike been running for more than 90 days?" and the agent calls the right tool. One thing worth knowing: there are 133 operations, which is a lot of tool descriptions for a model to carry. If your client lets you limit the tool list, enable only the ones you use.

If you'd rather not wire tools at all, there are four ready-made skills for Claude Code, Codex and Cursor in fetchproof/skill. They call the same API, run as a single Python script, and stop at a credit cap you set.

Using it from n8n

You don't need a community node. An HTTP Request node does it:

  • Method: GET
  • URL: https://api.fetchproof.com/v1/youtube/video/transcript
  • Authentication: Generic Credential Type → Header Auth (name x-api-key, value your key)
  • Send Query Parameters: url = {{ $json.url }}, language = en
  • Settings → On Error: Continue (regular output), so one bad URL doesn't stop a batch

I put four complete workflows on GitHub, MIT licensed, each one a JSON file you can import: fetchproof/n8n-templates. They cover YouTube transcript plus metadata, a weekly Meta Ad Library competitor monitor sorted by days running, a TikTok keyword search ranked by views per follower, and an Instagram creator audit. I imported all four into a fresh n8n install to check that they load.

What it costs

Most calls are 1 credit. Errors, blocked or timed-out requests, invalid requests and cache hits are free, and credits don't expire. After the 100 free credits, a pack is $27 for 25,000 credits. There's no subscription. Every operation lists its cost in the OpenAPI spec at https://api.fetchproof.com/openapi.json, so you can check a call before you make it.

Try it

Grab the 100 free credits at fetchproof.com, run the transcript curl above, and see whether the response shape suits what you're building. If it doesn't, say what's missing in the comments.

Top comments (0)