HonestHook

RankingsSign in

Tutorials

Linktree profile in JavaScript

One authenticated call to /api/v1/linktree/profile?handle=comedycentral, the response it returned, and the line that reads one field out of it.

What you need

Node 18 or later, where fetch is global. No package to install. The same code runs in a browser, except that a browser would expose your key — call this from your server.

The call

const url = "https://honesthook.com/api/v1/linktree/profile?handle=comedycentral";

const response = await fetch(url, {
  headers: { Authorization: `Bearer ${process.env.HH_KEY}` },
});

if (!response.ok) {
  throw new Error(`HTTP ${response.status}`);
}

const envelope = await response.json();
console.log(envelope.success, envelope.platform, envelope.endpoint);

What came back

{
  "success": true,
  "platform": "linktree",
  "endpoint": "linktree/profile",
  "data": {
    "author": {
      "id": "1847312",
      "handle": "comedycentral",
      "name": "Comedy Central",
      "followers": null,
      "following": null,
      "posts_count": null,
      "verified": null,
      "is_private": null
    },
    "items": [
      { "title": "Stream Comedy Central Shows on Paramount+", "url": "http://www.paramountplus.com/", "position": 1 },
      { "title": "Tales From The Trip Merch", "url": "https://comedycentralstore.com/collections/comedy-central", "position": 2 },
      { "title": "Comedy Central Merch Store", "url": "https://bit.ly/33Zo0Lp", "position": 3 },
      { "title": "Comedy Central YouTube", "url": "https://www.youtube.com/comedycentral", "position": 4 },
      { "title": "Animated YouTube", "url": "https://www.youtube.com/channel/UCqp9YsX6sR7i93CY4yGsAow", "position": 5 },
      { "title": "Stand-Up YouTube", "url": "https://www.youtube.com/standup", "position": 6 },
      { "title": "cc.com", "url": "http://www.cc.com/", "position": 7 }
    ]
  },
  "error": null,
  "cached": false
}

Recorded response, captured 27 Sep 2026. A live call returns the value at the moment you ask, not this one.

Every field in that capture

In JavaScriptType in this capture
envelope.successboolean
envelope.platformstring
envelope.endpointstring
envelope.data.author.idstring
envelope.data.author.handlestring
envelope.data.author.namestring
envelope.data.author.followersnull
envelope.data.author.followingnull
envelope.data.author.posts_countnull
envelope.data.author.verifiednull
envelope.data.author.is_privatenull
envelope.data.itemsarray (7 in this capture)
envelope.errornull
envelope.cachedboolean

A field we cannot read comes back null, never 0. A zero would be a claim about the account; null is a fact about our collection. The full list of what this route does not return is on linktree-api/profile.

Reading one field

console.log(envelope.data.items);

envelope is the object from the block above. Keep the key on the server: a key shipped to a browser is a key anyone can read.

This endpoint is the odd one of the set, and it is worth knowing why before you write the code: Linktree has no follower count. It is not a number we failed to read — it does not exist on the platform.

So five of the eight author fields come back null — followers, following and posts_count, plus verified and is_private — and the thing you actually came for is items: the list of links, in the order the owner put them in.

Read the list, not the counters

If you copy a snippet from another platform's tutorial and point it at Linktree, you will print None or null and conclude the call failed. It did not. Look at items.

The position on each item is the order the links arrive in — ours, derived, starting at one. It is not Linktree's own number. Linktree's internal values are a sparse key, not a rank, and publishing them as a position would turn an identifier into a ranking it never was.

What you are calling

One authenticated GET to our endpoint, with your key in an Authorization header. The handle in the example is the one that produced the recorded response below.

Before you copy the block

Keep the key in an environment variable — all three examples read HH_KEY.

Then read the field list. The link thumbnails and the campaign parameters some links carry are deliberately not here.

The endpoint itself

Parameters, the handle format, what the route does not return and what a call costs: linktree-api/profile.

The same call in curl · Python.

Free key, 1,000 credits a month

Every example above runs against the real endpoint as soon as you have a key. No card, and the key arrives in seconds.

Get a key →

← Tutorials · linktree-api · Pricing