HonestHook

RankingsSign in

Tutorials

Pinterest profile in JavaScript

One authenticated call to /api/v1/pinterest/profile?handle=pinterest, 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/pinterest/profile?handle=pinterest";

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": "pinterest",
  "endpoint": "pinterest/profile",
  "data": {
    "author": {
      "id": "pinterest",
      "handle": "pinterest",
      "name": "Pinterest",
      "followers": 6264894,
      "following": null,
      "posts_count": null,
      "verified": null,
      "is_private": null
    }
  },
  "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.followersnumber
envelope.data.author.followingnull
envelope.data.author.posts_countnull
envelope.data.author.verifiednull
envelope.data.author.is_privatenull
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 pinterest-api/profile.

Reading one field

console.log(envelope.data.author.followers);

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.

A Pinterest profile page carries dozens of counters that share the same name. Boards have followers. The profile has followers. They are different numbers sitting in the same document, and a regular expression that grabs the first match returns a board's count while looking exactly like a success.

That is the bug this endpoint was built to not have.

Where the number comes from

The follower count here is read from the page's structured ld+json profile block — the one place in the document that says which entity the number belongs to. Not from the markup, and not from the text beside it.

You do not have to do any of that. You make one call. But it is worth knowing, because it is the difference between a number you can publish and a number that is merely plausible — and a plausible wrong number is the expensive kind: nothing errors, the value looks fine, and it is a board's.

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. Pinterest has several different badges and no single verified flag, so that field is null rather than a badge the platform never gave.

The endpoint itself

Parameters, the handle format, what the route does not return and what a call costs: pinterest-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 · pinterest-api · Pricing