Social Media Scraping

How to Scrape Linktree (and Find Emails or Social Links)

@adrian_horning_
2 mins read
Image of mock linktree page on left and the json representation on the right

Table of Contents

Why Scrape Linktree?

Linktree is a popular tool used by creators to display all their important links, emails, social media accounts, websites, and more. That makes it a goldmine for anyone looking to extract useful contact info like:

  • Emails
  • Social media links (Instagram, YouTube, TikTok, etc.)
  • Websites or personal blogs

Step-by-Step: How Linktree Works Under the Hood

Let’s walk through scraping a Linktree page using this example:
https://linktr.ee/miguelangeles

  1. Open Dev Tools
    Right-click → Inspect → Go to the Network tab.
  2. Refresh the Page
    The very first request is for the HTML document.
  3. Click on the first request
    It should be miguelangeles
  4. Go to the response tab
  5. Search for __NEXT_DATA__
    In the HTML response, search for __NEXT_DATA__. This is where Linktree stores a full JSON blob of the page’s data (thanks Next.js for making this super easy to scrape). This includes things like:
    • EMAIL_ADDRESS
    • Social links
    • URLs
    • Profile Data

Scrape Linktree with Node.js

Here’s how to do it in code using got-scraping and cheerio:

 import { gotScraping } from 'got-scraping'
import * as cheerio from 'cheerio'

async function scrapeLinktree(username) {
  const url = `https://linktr.ee/${username}`
  const response = await gotScraping({
    url,
    proxyUrl: "PROXY_URL_HERE"
  })

  const $ = cheerio.load(body)
  const nextScript = $('#__NEXT_DATA__').html()

  const data = JSON.parse(nextScript)

  return data;
}

scrapeLinktree('miguelangeles').then(console.log)

Use a Proxy for Scale

If you're scraping lots of Linktree pages, use a proxy to avoid rate limits or bans. Good options include:

Bonus: Scrape Linktree's Public Directory

You can discover thousands of profiles using their discover API:

https://linktr.ee/discover/_next/data/zd5lRJ4hQhc2caWwdfD1Z/profile-directory/c/all/page-1.json?category=all&page=page-1

Just change the page number to increment.
⚠️ If Linktree updates their site, that zd5lRJ4hQhc2caWwdfD1Z hash will change. To get the latest:

  1. Visit https://linktr.ee/discover/profile-directory/c/all/page-1/
  2. Open Dev Tools → Network → Watch for requests when you paginate

Or Use our Prebuilt Linktree Scraper!

Don’t want to code this yourself?

Use my Linktree Scraper, quick, easy, and real-time.

Need more? Scrape Creators also supports:

  • Instagram
  • TikTok
  • YouTube
  • Truth Social
  • Ad libraries for Meta, LinkedIn, Google, and Reddit

Sign up for 100 free requests, no credit card required!

Frequently Asked Questions

Scraping public information is totally fair game.
Yes, if the user has added their email to their profile, it's in the __NEXT_DATA__ json.

Try the ScrapeCreators API

Get 100 free API requests

No credit card required. Instant access.

Start building with real-time social media data in minutes. Join thousands of developers and businesses using ScrapeCreators.