# Linktree Scraper - Bio Links & Destination URLs (`xtracto/linktree-scraper`) Actor

Extract every destination URL behind a Linktree bio-link page, plus the account's title, description, avatar, tier, country and creation date. Reads the page's embedded data island, so it returns fields the page never displays. HTTP-only, no account.

- **URL**: https://apify.com/xtracto/linktree-scraper.md
- **Developed by:** [Farhan Febrian Nauval](https://apify.com/xtracto) (community)
- **Categories:** Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.67 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Linktree Scraper — Bio Links & Destination URLs

Extract every destination URL behind a Linktree bio-link page, plus the account's title,
description, avatar, tier, country and creation date. HTTP-only, no account, no browser.

Useful when you have a list of creators or brands and want the links they actually point people
at — the shop, the newsletter, the booking page — rather than just the bio-link URL.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `profiles` | array | *required* | Usernames (`spotify`), `@handles`, or full URLs (`https://linktr.ee/spotify`) |
| `maxConcurrency` | integer | `5` | Profiles fetched in parallel |
| `proxyConfiguration` | object | Apify proxy | Optional — a bare IP worked in testing |

### Output

One row per input, always — including failures, so downstream joins never silently lose a key.

```jsonc
{
  "_input": "spotify",
  "_source": "S1-next-data",
  "_scrapedAt": "2026-09-07T01:52:39Z",

  "username": "spotify",
  "profileUrl": "https://linktr.ee/spotify",
  "pageTitle": "@spotify",
  "description": "…",
  "profilePictureUrl": "…",
  "tier": "free",
  "country": "US",
  "createdAt": 1557790392,
  "isActive": true,
  "isUnclaimedAccount": false,

  "linkCount": 6,
  "urls": ["https://open.spotify.com/…", "…"],   // flat list of destinations
  "links": [                                      // structured, with Linktree's own fields
    { "id": "9964805", "title": "Playlist 1", "url": "https://open.spotify.com/…",
      "type": "CLASSIC", "position": 0, "_depth": 0 }
  ],
  "pinnedLinks": [],
  "socialLinks": []
}
```

Failure rows carry `_error` (`not_found`, `bad_input`, `blocked`, `unexpected_shape`) and
`_errorDetail`, and no payload.

### How it works

Everything comes from the `__NEXT_DATA__` island Next.js ships with the page, not from the
rendered markup. That is both more stable across redesigns and richer — `tier`, `country`,
`createdAt` and link `position` are all in the island and never shown on the page.

Two details worth knowing, because both cause silent wrong answers if you get them wrong:

**Select the island by id, not by a regex over its opening tag.** Linktree renders it as
`<script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">`. A regex written
against the usual two-attribute form matches nothing, and the page then looks empty rather than
broken.

**A 200 is not proof the profile exists.** Linktree answers an unregistered handle with a normal
200 "claim this username" page that still carries a `__NEXT_DATA__` island — so the parse
succeeds and every field comes back `null`. This actor checks for account identity markers
(`id`, `uuid`, `createdAt`, `pageTitle`, `username`) and emits `not_found` instead of a
null-filled row that looks like a successful scrape of an empty profile.

**Nested links are flattened.** Linktree lets a link be an expandable group with `children`.
Each descendant is emitted as its own row in `links` with a `_depth` and `_parentTitle`, so you
get every destination URL without walking a tree but can still reconstruct the grouping.

### Known limits

| Limit | Detail |
|---|---|
| No click analytics | View and click counts are private to the account owner |
| No email capture | Linktree's email-signup blocks expose no collected addresses |
| Gated profiles | Pages behind a password or age gate return no links |

# Actor input Schema

## `profiles` (type: `array`):

Linktree usernames (spotify), @handles, or full URLs (https://linktr.ee/spotify). One row is emitted per entry, including for failures.

## `maxConcurrency` (type: `integer`):

Profiles fetched in parallel.

## `proxyConfiguration` (type: `object`):

Optional. Linktree served a bare IP fine in testing; use a proxy for sustained volume.

## Actor input object example

```json
{
  "profiles": [
    "spotify",
    "@bbcnews"
  ],
  "maxConcurrency": 5,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `profiles` (type: `string`):

Dataset items shown in the 'Profiles' view.

## `items` (type: `string`):

Every record this run produced, with all fields, as JSON.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "profiles": [
        "https://linktr.ee/spotify"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("xtracto/linktree-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "profiles": ["https://linktr.ee/spotify"] }

# Run the Actor and wait for it to finish
run = client.actor("xtracto/linktree-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "profiles": [
    "https://linktr.ee/spotify"
  ]
}' |
apify call xtracto/linktree-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,xtracto/linktree-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/AwwJy4NjhyvLdCS8I/builds/pay0rhQ6rMoIs1WAy/openapi.json
