Dev.to WebDev 🛠 Dev 👁 0 📖 3 min read

Building a 128MB Creator Link-in-Bio Email & Brand-Deal Enricher (Fixing Linktree Footer Noise & False Promo Codes)

Influencer marketing teams spend hours clicking through Linktree, Stan.store, Bio.site, Beacons, Komi, and Carrd profiles just to copy one business email, count social channels, and see whether a creator already does bra

Influencer marketing teams spend hours clicking through Linktree, Stan.store, Bio.site, Beacons, Komi, and Carrd profiles just to copy one business email, count social channels, and see whether a creator already does brand sponsorships.

Existing scrapers either force expensive residential proxies, charge $5+/1K for raw link dumps (even when a profile is deleted), or crash inside lightweight containers.

Here is how I built a 128 MB RAM, zero-proxy Creator Link-in-Bio Enricher in Node.js — plus the three real-world parsing bugs we caught during live cloud testing before hitting 0.66-second execution on 128 MB RAM.

1. The Linktree __NEXT_DATA__ Trap: 100+ SEO Footer Links Contaminating Creator Profiles

On first live test against https://linktr.ee/apify and https://linktr.ee/shopify, extracting all <a href> tags via Cheerio after parsing __NEXT_DATA__ returned 120+ unrelated links per profile.

Why? Modern Linktree HTML renders an entire discovery & footer block in the DOM filled with unrelated profiles (linktr.ee/arianagrande) and marketing blog URLs (linktr.ee/tools/qr-code-generator, Black Friday marketing ideas).

The Fix: Structured JSON First, DOM Links Only as Fallback

Because Linktree embeds the creator's authoritative links inside <script id="__NEXT_DATA__">, parsing __NEXT_DATA__ (pp.links, acc.links, pp.pinnedLinks, pp.shopLinks, pp.socialLinks) and skipping general DOM <a> scraping whenever hasStructuredLinktreeData is true drops link counts from 120+ noisy SEO links down to the creator's true links:

if (!hasStructuredLinktreeData) {
    $('a[href]').each((_, el) => {
        if ($(el).closest('footer, nav').length > 0 && platform !== 'custom_website') {
            const h = $(el).attr('href') || '';
            if (!/^(mailto:|tel:)/i.test(h)) return;
        }
        const href = $(el).attr('href');
        const text = $(el).text().replace(/\s+/g, ' ').trim() || '';
        if (href) addLink(href, text);
    });
}

Combined with pre-Cheerio buildSlimHtml() (extracting __NEXT_DATA__ + JSON-LD, then stripping <script>/<style>/<svg>/<noscript>/<template> before cheerio.load()), even 500 KB+ pages use only a few MB of RAM.

2. False Promo Codes (GENERATORTURN) & False Affiliate Flags

Naive regexes turn normal English sentences into fake discount codes. Our initial pattern /\bcode\s*[:\-]?\s*([A-Z0-9_-]{3,20})/i matched "QR code generatorTurn" and emitted GENERATORTURN! Worse, Linktree sets account flag isAmazonAffiliateEnabled: false or boolean metadata even when a creator has zero affiliate links.

Fixing both took two targeted guards:

  1. Enforce uppercase-only code captures on loose "code X" / "using X" phrases alongside an explicit stopword set (GENERATOR, GENERATORTURN, PROMO, LINK, FREE), so "Get money off your order using TRASKA" extracts "TRASKA" while ignoring lowercase prose.
  2. Rely only on explicit profileHasAffiliateContent === true plus real affiliate link URL matching (amazon.*/shop/, amzn.to, shopltk.com, shopmy.us, rvlv.me).

3. Sequential 1-Hop Deep Contact Follow Without Blowing 128 MB RAM

Often a creator's bio page lists no email directly, only a link to their personal website, Contact, or Media Kit.

When no agency or business email appears on the bio page (enableDeepContactFollow: true), our enricher picks up to 2 eligible creator-owned links — skipping big social networks, Amazon/LTK storefronts, and generic support.* / help.* subdomains — and inspects them sequentially with per-hop SSRF + DNS rebinding protection (redirect: 'manual', blocking loopback/private/metadata IPv4, IPv6, and ::ffff: ranges). Stopping early the moment an agency or business email is recovered keeps 128 MB containers rock-solid.

Live verification on Apify Cloud (128 MB container, Build 0.1.3) across 6 mixed inputs (Linktree creators halleykmcg and averagefashionblogger, stan.store/stan, bio.site/squarespace, a 404 profile, and http://127.0.0.1/admin):

  • Total duration: 0.66s (OOM: 0)
  • Enriched & billed: 4 / 6 (agency email [email protected] + Readiness Score 70, [email protected], Stan digital products, Bio.site 6 socials)
  • Zero-cost rejections ($0): 404 page (not_found) and http://127.0.0.1/admin (blocked_ssrf) were never saved or billed.

Try the Actor, MCP Tool, or Google Sheets n8n Workflow

Import 04-creator-link-in-bio-email-enricher-sheets.json into n8n to turn a Google Sheet of Instagram/TikTok bio URLs into outreach-ready creator emails, discount codes, and Brand-Deal Readiness Scores in one click.

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.