LINKEDIN PROFILE API

Example HTTP Request: Retrieve a LinkedIn Profile as JSON

An example HTTP request for retrieving a LinkedIn profile as JSON, annotated line by line: request line, headers, body, response headers, status and JSON.

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

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

Example HTTP Request: Retrieve a LinkedIn Profile as JSON

An HTTP request that retrieves a LinkedIn profile as JSON is a POST with three parts: a request line naming the endpoint, headers carrying your API key and the content type, and a one-line JSON body holding the profile URL. With ProfileHunt the response is HTTP 200, a few headers including your remaining rate limit, and a JSON body with a status and the profile. This post shows that exchange exactly as it travels over the wire and explains every line.

For what a profile API is and why it returns the public view, see what a LinkedIn profile API is.

Key takeaways

  • The request is five lines and a body. Request line, Host, Authorization, Content-Type, Content-Length, then {"url":"..."}.
  • The response status and the body status are different things. HTTP 200 says the request worked; the body's status says whether the profile was found.
  • Rate-limit headers come back on every counted request. X-RateLimit-Limit and X-RateLimit-Remaining tell you where you stand this minute.
  • Errors are short JSON too. Anything other than 200 has a body like {"error":"invalid_url"}.

The full exchange at a glance

This is the request a client sends, shown as HTTP/1.1 text. The key is shortened:

POST /v1/profile HTTP/1.1
Host: api.profilehunt.dev
Authorization: Bearer ph_live_…
Content-Type: application/json
Content-Length: 51

{"url":"https://www.linkedin.com/in/williamhgates"}

And this is the response, with the body formatted for reading and shortened:

HTTP/1.1 200 OK
Content-Type: application/json
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 59

{
  "status": "ok",
  "profile": {
    "public_id": "williamhgates",
    "profile_url": "https://www.linkedin.com/in/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, "...": "..." }
    ],
    "education": [
      { "school": "Harvard University", "start_date": "1973", "end_date": "1975", "...": "..." }
    ],
    "followers": 40725248,
    "connections": 8,
    "creator": true,
    "last_post_at": "2026-10-12T20:10:59.000Z",
    "scraped_at": "2026-10-13T09:00:00.000Z",
    "...": "..."
  }
}

Your client will also show general HTTP headers such as Date and Content-Length. The ones listed above are the ones that matter to your code.

A stack of thin tiles taken apart into layers with a key on one layer

The request, line by line

LineWhat it doesNotes
POST /v1/profile HTTP/1.1Method, path and protocolAlways POST; the URL goes in the body, not the query string.
Host: api.profilehunt.devWhich server you meanYour HTTP client adds it from the URL.
Authorization: Bearer ph_live_…Your API keyx-api-key: ph_live_… works the same. A missing or wrong key gets 401.
Content-Type: application/jsonSays the body is JSONEvery documented example sends it; send it too.
Content-Length: 51Size of the body in bytesYour client computes it.
(blank line)End of headersRequired by HTTP.
{"url":"https://www.linkedin.com/in/williamhgates"}The profile to readurl is the only field.

Three details about the body. First, url accepts loose input: with or without https:// and www., a country subdomain such as uk.linkedin.com, a trailing slash or a query string. Second, anything that isn't a linkedin.com/in/ profile link, such as a company page or a bare username, gets 422 with {"error":"invalid_url"} and no charge. Third, there are no other parameters to set: no field selection, no format flag. You always get the full profile object. The profile endpoint reference is the formal definition.

The response, line by line

The status line. HTTP/1.1 200 OK means the API understood the request and finished the lookup. It does not mean the profile was found; that's in the body.

The headers.

HeaderExampleWhat it tells you
Content-Typeapplication/jsonThe body is JSON, on success and on error.
X-RateLimit-Limit60Requests this key may make per minute.
X-RateLimit-Remaining59Requests left in the current clock minute.

The minute is a clock minute, so X-RateLimit-Remaining resets at the start of each minute, not 60 seconds after your first call.

The body. The JSON has two keys at the top level:

  • status: ok, gone or unavailable.
  • profile: the profile object when status is ok, otherwise null.

Inside profile, every key is always present, and a value the profile doesn't show publicly is null (or [] for a list). Dates of roles and schools are strings as LinkedIn shows them, "2000" or "2014-02"; timestamps such as last_post_at and scraped_at are ISO 8601 in UTC. On the wire the body is compact JSON on one line; it is formatted above only for reading. The JSON schema guide explains every field.

An open parcel box with neat nested blocks inside next to a small dial

When the exchange doesn't return a profile

The same request can come back four other ways. All of them use the same JSON Content-Type, and none of them costs a credit.

No public profile at the URL. Still HTTP 200, because the request itself succeeded:

HTTP/1.1 200 OK
Content-Type: application/json
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 58

{"status":"gone","profile":null}

unavailable looks the same with "status":"unavailable": LinkedIn didn't serve the profile just then, and a later retry can succeed.

A URL that isn't a profile link:

HTTP/1.1 422 Unprocessable Entity
Content-Type: application/json

{"error":"invalid_url"}

Over the rate limit:

HTTP/1.1 429 Too Many Requests
Content-Type: application/json
Retry-After: 12
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 0

{"error":"rate_limited"}

Retry-After is the number of seconds until the next minute starts. A missing or wrong key returns 401 with {"error":"unauthorized"}. The errors reference has the full table, including 402, 503 and 504, and how to interpret status codes adds what to do about each.

What Most Guides Get Wrong About Profile API HTTP Examples

They show only the body. A JSON snippet without the status line and headers hides the two things that drive client logic: whether the request succeeded and how many calls are left this minute. Reading X-RateLimit-Remaining is how a well-behaved client slows down before it hits 429.

They equate HTTP 200 with "found". In this API, 200 can carry gone or unavailable. Code that branches only on the HTTP status will write empty records for every private profile.

They put the key or the URL in the query string. A profile URL in a GET query string ends up in proxy and server logs and has to be URL-encoded. Here the key goes in a header and the profile URL in a JSON body, which keeps both out of logged URLs.

Myth vs Reality

MythReality
"Header names must match the case in the docs."HTTP header names are case-insensitive (RFC 9110). Over HTTP/2 they are sent in lowercase.
"An error means something is wrong with my account."Most errors are about the single request: a bad URL (422) or too many calls this minute (429). Only 401 and 402 point at the key or the balance.
"A 429 costs a credit."Rate-limited requests are refused before any lookup and are never charged.
"The JSON shape changes from profile to profile."Every key is always present; only the values change, with null or [] for anything not shown.

Advanced: Seeing and Using the Raw Exchange

This section is for readers debugging an integration or writing their own client.

  • See it with cURL. curl -v prints the request headers (lines starting with >) and the response headers (<). curl -i prints only the response headers above the body. Both are enough to check that your key header and content type are what you think they are.
  • Read the headers in code. In Node.js, res.headers.get("x-ratelimit-remaining"); in Python requests, res.headers["X-RateLimit-Remaining"]. Both lookups are case-insensitive.
  • Know what counts. Each POST /v1/profile, and each batch creation, counts against the 60 a minute; polling a batch doesn't. Validating URLs before you send them saves round trips.
  • Find a request later. Every lookup appears on the dashboard's Usage page with an ID starting req_. Quote it with the profile URL when you contact support.
  • Map it to other tools. Postman, Insomnia, n8n's HTTP Request node or Make's HTTP module all need the same four settings: POST, the URL, the Authorization header and the JSON body. The settings table for any HTTP client lists them per tool.

If you want to see this request used to fill in a contact record, with fields mapped from the response into a CRM row, the HTTP request example for profile enrichment covers that step.

Where ProfileHunt Fits

ProfileHunt is a LinkedIn Profile API: one HTTP POST with a public profile URL returns the profile as structured JSON, with no LinkedIn login, cookie or seat involved. The exchange above is the whole interface for a single profile; the batch API uses the same headers to take up to 100 URLs at once. Found profiles cost one credit each, $0.50 per 1,000, and every other outcome is free.

The JSON is the public view of a profile. It has no email addresses or phone numbers, past roles have no titles, and connections is capped at 500.

Getting Started

Sign in at /login for 100 free credits with a work email, then run the request with curl -v and compare it with the exchange above. For a step-by-step first call in cURL, Python and Node.js, follow how to retrieve one LinkedIn profile with an API request. The rate limit docs cover the headers in detail, and what a LinkedIn profile API is covers the background.

Frequently asked questions

What does an HTTP request to a LinkedIn profile API look like?

With ProfileHunt it is POST /v1/profile to api.profilehunt.dev, with Authorization: Bearer <key> and Content-Type: application/json headers and the body {"url":"https://www.linkedin.com/in/<name>"}.

Why does the LinkedIn profile API return 200 when the profile isn't found?

Because the request itself succeeded. The outcome of the lookup is in the body: status is gone when there is no public profile at the URL, and profile is null. It is not charged.

Which response headers does the ProfileHunt API send?

Content-Type: application/json on every response, X-RateLimit-Limit and X-RateLimit-Remaining on every counted request, and Retry-After with 429 and 503 responses.

Can I send the LinkedIn profile URL as a query parameter?

No. The profile endpoint takes a POST with the URL in a JSON body as url. Keeping it in the body also keeps it out of logged URLs.

How do I see the raw HTTP request and response with curl?

Add -v to your cURL command. Lines starting with > are what you sent and lines starting with < are the response headers, followed by the JSON body.

Get API key 100 free credits with a work email