LINKEDIN PROFILE API

How to Retrieve One LinkedIn Profile with an API Request

Retrieve one LinkedIn profile with a single API request: get a key, send the profile URL, check the status, and read the fields from the JSON response.

By Surender Kumar, GTM Engineer, ProfileHunt · Published · 9 min read

Also in: Español · Português (Brasil) · Deutsch · Français · 简体中文 · हिन्दी · العربية · বাংলা · Русский · Bahasa Indonesia · اردو · 日本語 · मराठी · Tiếng Việt · తెలుగు · Hausa · Türkçe · தமிழ் · 한국어

How to Retrieve One LinkedIn Profile with an API Request

To retrieve one LinkedIn profile with an API request, send a POST to a profile API with your API key in a header and the public profile URL in a JSON body. With ProfileHunt that is one call to https://api.profilehunt.dev/v1/profile; it waits while the profile is read, usually a few seconds, and answers with a status and the profile as JSON. This guide walks through it from zero: getting a key, sending the request, and reading what comes back.

If you want the concepts first, read what a LinkedIn profile API is, then come back here to make your first call.

Key takeaways

  • One profile is one request. A POST with a key and { "url": "..." } returns that profile's public view as JSON.
  • Check status before anything else. HTTP 200 can mean ok, gone or unavailable; only ok has a profile.
  • Only found profiles cost a credit. gone and unavailable are free, and so are errors such as a bad URL or an exceeded rate limit.
  • Every key is always present. A value the profile doesn't show publicly is null, or [] for a list.

What you need before you start

You need three things, and none of them is a LinkedIn account:

WhatWhere it comes from
An API keyThe Keys page after you sign in at profilehunt.dev/login
CreditsFree on sign-up: 100 with a work email, 10 with a personal one
A public profile URLAny linkedin.com/in/... link, such as https://www.linkedin.com/in/williamhgates

A terminal with curl is enough for the first call. Python and Node.js versions follow in Step 4.

Six blocks rising like a staircase toward a single arrow

How to retrieve one profile, step by step

Step 1: Get an API key

Sign in at profilehunt.dev/login with Google or an emailed sign-in link. Your first sign-in creates a workspace with a key named Default and adds your free credits. Copy the key from the Keys page. Keys belong to the workspace, and every key in it draws from the same credit balance.

Step 2: Put the key in an environment variable

Keep the key out of your code so it never ends up in source control. In a terminal:

export PROFILEHUNT_KEY="paste-your-key-here"

Every example below reads the key from PROFILEHUNT_KEY. The authentication docs cover the two accepted headers and how to rotate a key.

Step 3: Pick the profile URL

Use the address of a public LinkedIn profile: linkedin.com/in/ followed by the profile's name. The API is forgiving about the rest. With or without https:// and www., on a country subdomain such as uk.linkedin.com, with a trailing slash or a query string, it all resolves to the same profile.

What it refuses: company pages, bare usernames and anything that isn't a /in/ link. Those get 422 invalid_url and cost nothing.

Step 4: Send the request

This is the whole request in cURL:

curl -X POST https://api.profilehunt.dev/v1/profile \
  -H "Authorization: Bearer $PROFILEHUNT_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://www.linkedin.com/in/williamhgates" }'

The same in Python with requests:

import os, requests

res = requests.post(
    "https://api.profilehunt.dev/v1/profile",
    headers={"Authorization": f"Bearer {os.environ['PROFILEHUNT_KEY']}"},
    json={"url": "https://www.linkedin.com/in/williamhgates"},
)
data = res.json()
print(data["status"])

And in Node.js 18 or later, where fetch is built in:

const res = await fetch("https://api.profilehunt.dev/v1/profile", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.PROFILEHUNT_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ url: "https://www.linkedin.com/in/williamhgates" }),
});
const data = await res.json();
console.log(data.status);

If your tool can't set an Authorization header, send the key as x-api-key: <key> instead. Both work the same way.

Step 5: Check the status first

A request that reached the API and was understood returns HTTP 200 with one of three statuses:

statusWhat it meansprofileCredit
okThe profile was foundThe profile object1
goneNo public profile at this URL: private, deleted, never existed, or removed at the member's requestnull0
unavailableLinkedIn didn't serve the profile just then; try again laternull0

Anything that isn't HTTP 200 is an error with a short JSON body such as { "error": "invalid_url" }. The common ones on a first call are 401 (key missing or wrong), 402 (out of credits), 422 (not a profile URL) and 429 (over 60 requests a minute on this key). None of them uses a credit. The errors reference lists every code and whether to retry.

Step 6: Read the fields you need

When status is ok, the profile sits under profile. A shortened response for the sample URL:

{
  "status": "ok",
  "profile": {
    "public_id": "williamhgates",
    "full_name": "Bill Gates",
    "headline": "Chair, Gates Foundation and Founder, Breakthrough Energy",
    "location": "Seattle, Washington, United States",
    "country": "US",
    "experience": [
      { "company": "Gates Foundation", "title": "Co-chair", "start_date": "2000", "end_date": null }
    ],
    "followers": 40725248,
    "last_post_at": "2026-10-12T20:10:59.000Z",
    "scraped_at": "2026-10-13T09:00:00.000Z"
  }
}

The real response has more keys: education, about, photo, connections, badges, recent posts, articles, reactions and comments. Reading a few of them in Python:

if data["status"] == "ok":
    p = data["profile"]
    current = [r for r in p["experience"] if r["end_date"] is None]
    print(p["full_name"], "|", p["headline"])
    print("Current roles:", [(r["company"], r["title"]) for r in current])
    print("Read at:", p["scraped_at"])
else:
    print("No profile:", data["status"])

A current role is one with end_date: null. Some people have several, so treat "current job" as a list. For what every field means and its type, see the LinkedIn profile JSON schema guide.

A balance scale holding one bright block next to a closed lock

What Most Guides Get Wrong About Retrieving a LinkedIn Profile

They read profile without checking status. Most snippets jump straight to res.json()["profile"]["full_name"]. That works on the demo URL and crashes the first time a profile is gone, because profile is null. Branch on status first.

They treat HTTP 200 as success. For a profile API that reports outcomes in the body, 200 means "the request worked", not "the profile was found". A private or deleted profile is a normal, expected answer, not an error, and it comes back as 200 with status: "gone".

They promise data the public view doesn't have. A public profile API returns what LinkedIn shows a logged-out visitor. That means no email address, no phone number, and no job titles for past roles: past positions come back with a company and dates but title: null. connections stops at 500, because LinkedIn shows "500+" above that. Plan around those limits from the first request.

Myth vs Reality

MythReality
"You need a LinkedIn account or a cookie to get profile data by API."ProfileHunt reads the public view. You sign up with an email and use an API key; no LinkedIn login, cookie or Sales Navigator seat is involved.
"The URL has to be in one exact format."https://, www., country subdomains, trailing slashes and query strings are all accepted. Only non-profile links are refused.
"A failed lookup still costs a credit."Only ok uses a credit. gone, unavailable, timeouts and errors cost nothing.
"Calling the same profile twice returns a cached copy."Every call reads the profile live and uses a credit if it's found. Cache in your own system if you need the same profile again.
"Missing data means a missing key."Every key is always present. Check for null or [], not for the key.

Advanced: Turning One Request into a Reusable Function

Once the first call works, wrap it so the rest of your code never deals with raw HTTP. This section assumes you are comfortable with the request above.

import os, time, requests

API = "https://api.profilehunt.dev/v1/profile"
HEADERS = {"Authorization": f"Bearer {os.environ['PROFILEHUNT_KEY']}"}

def get_profile(url: str) -> tuple[str, dict | None]:
    """Return (status, profile): status is "ok", "gone" or "unavailable"."""
    for attempt in range(3):
        res = requests.post(API, headers=HEADERS, json={"url": url}, timeout=120)
        if res.status_code in (429, 503):
            time.sleep(int(res.headers.get("Retry-After", "5")))
            continue
        if res.status_code in (500, 502, 504):
            time.sleep(2 ** attempt)
            continue
        res.raise_for_status()  # 401, 402, 422: fix the input, don't retry
        data = res.json()
        return data["status"], data["profile"]
    raise RuntimeError(f"No answer for {url} after 3 attempts")

Four details in that function matter in production:

  • Retry-After is in seconds. It comes with 429 and 503, and waiting that long is all a rate-limited call needs.
  • Retries are free. Every outcome except ok refunds its credit, so a retry never charges twice.
  • gone is final, unavailable is not. Mark a gone record and move on; put an unavailable one back in the queue for a later run rather than retrying it straight away.
  • The client timeout is generous on purpose. A lookup usually takes a few seconds, but give the API room to answer with its own 504 timeout rather than having your client give up first.

The full retry matrix, in JavaScript and Python, is in response status handling for failed lookups.

For more than a handful of profiles, don't loop this function over a list. Use the batch API, which takes up to 100 URLs per request and counts as one request against the rate limit.

Where ProfileHunt Fits

ProfileHunt is a LinkedIn Profile API: public profile URL in, structured JSON out, pay only for profiles found. One request returns identity, headline, about, location, experience, education, followers, connections, recent posts, reactions and comments, read live, with a scraped_at timestamp. Credits cost $1 for 2,000, which is $0.50 per 1,000 profiles found, with no subscription and no expiry.

ProfileHunt returns the public view only. If you need email addresses, phone numbers or members-only details, those come from other sources; LinkedIn's public view doesn't include them.

Getting Started

Sign in at /login for 100 free credits with a work email, copy your key, and run the cURL command from Step 4. The quickstart has the same call in three languages, and the profile endpoint reference lists every field. To build this into a product, read how to design around the single LinkedIn profile lookup endpoint, and for the full background, what a LinkedIn profile API is.

Frequently asked questions

How do I get LinkedIn profile data from a profile URL with an API?

Send a POST to https://api.profilehunt.dev/v1/profile with your API key in the Authorization header and { "url": "<profile URL>" } as the JSON body. The response has a status and, when it is ok, the profile as JSON.

Do I need a LinkedIn account to call a LinkedIn profile API?

Not with ProfileHunt. You sign up with an email, get an API key and send requests. No LinkedIn login, cookie or Sales Navigator seat is used.

How long does a single LinkedIn profile API request take?

The request waits while the profile is read live, usually a few seconds. A lookup that runs too long ends with 504 timeout and is not charged.

What happens if the LinkedIn profile is private or deleted?

You get HTTP 200 with status: "gone" and profile: null, and no credit is used. Don't retry it; there is no public profile at that URL.

How much does it cost to retrieve one LinkedIn profile?

One credit when the profile is found, which is $0.0005 at $1 for 2,000 credits. Profiles that come back gone or unavailable cost nothing.

Can I see the raw HTTP request and response?

Yes. Add -v to the cURL command to see the request and response headers. The annotated HTTP example walks through every line of the exchange.

Get API key 100 free credits with a work email