Use Social Fetch to turn a public LinkedIn profile or company page into JSON, a structured response your code can read. This guide looks up Bill Gates and Microsoft, checks for a missing profile, then saves company details as CSV rows. Every route it uses is listed on the LinkedIn scraper API page. To look at one profile without code, the free LinkedIn profile viewer shows it with no LinkedIn login.
You'll need a Social Fetch account, credits and an API key. You can try the requests in the Playground before writing code. For help creating a key, follow the API quickstart. Keep the key in an environment variable; never put it in browser code or a shared screenshot.
Choose the right lookup
A person profile has an /in/ URL, such as https://www.linkedin.com/in/williamhgates. A company page has a /company/ URL, such as https://www.linkedin.com/company/microsoft.
For a person, use GET /v2/linkedin/profiles with handle=williamhgates. For a company, use GET /v1/linkedin/companies with the full page URL in url. These routes have different versions and response fields, so keep each example's path and parameters together.
A browser scrape also has to handle what LinkedIn shows to a signed-out visitor. In this capture, opening Bill Gates's public profile leads to an account prompt. It is one observed page state, rather than a guarantee that every public URL behaves the same way.

For the maintenance involved in a browser scraper, see Social Fetch vs DIY scraping. For LinkedIn's approved app products, see LinkedIn partner APIs and public data.
Get a person profile
- Open the profile lookup in the Playground.
- Under LinkedIn, select Profile. Check that the path is
/v2/linkedin/profiles. - Enter
williamhgatesin handle. Leave entityId empty: the request accepts either a handle or an entity ID, not both. - Select Send, then read the Response tab. Sending a request spends credits; Example response shows static sample data.

A completed person lookup costs 5 credits. The response has data.lookupStatus and data.profile; the name is profile.fullName. Other profile fields include headline, location, followerCount and profilePictureUrl. An image URL is a link your app can load, not image bytes. Fields can be null when no value was returned.
Run the same request from your own code with the tabs below. Use Node.js 18 or later. Set SOCIALFETCH_API_KEY in the terminal where you run the examples, using your own key:
In PowerShell, use $env:SOCIALFETCH_API_KEY = "your-api-key" instead. Keep the real key out of source files.
For the Node.js tab, save the code as linkedin-profile.mjs and run node linkedin-profile.mjs. Node provides fetch, so no package is needed. The .mjs extension enables top-level await even in a CommonJS project.
For the TypeScript SDK tab and the branching example below, install the SDK and runner:
Save the TypeScript tab as linkedin-profile.mts and run npx tsx linkedin-profile.mts. The .mts extension enables ES modules and top-level await; the SDK is ESM-only. These filenames work without changing your project's package type. The SDK guide explains the client in more detail.
curl -sS \
-H "x-api-key: $SOCIALFETCH_API_KEY" \
-G "https://api.socialfetch.dev/v2/linkedin/profiles" \
--data-urlencode "handle=williamhgates"The SDK returns a Result: check result.ok before accessing result.value. Save this branching example as linkedin-profile-result.mts and run npx tsx linkedin-profile-result.mts with the same setup. HTTP success and a found profile are separate checks:
Handle a missing profile
A completed lookup can return HTTP 200 with lookupStatus: "not_found" and profile: null. Do not create an empty contact record just because the request succeeded.

The screenshot uses a deliberately nonexistent handle. You can reuse the branching code above without spending credits to repeat this test. An HTTP error is different: read the error envelope, fix invalid parameters, or follow the retry guidance in Errors. Keep the request ID when you contact support.
For a list of person URLs, use GET /v2/linkedin/profiles/batch. It accepts repeated url parameters, with up to 50 URLs per request. Read each data.results[] entry's lookupStatus, profile, error and creditsCharged; do not apply the single-profile response shape to a batch.
Get a company page
- Open the company lookup in the Playground.
- Select Company page, and enter
https://www.linkedin.com/company/microsoftin url. - Select Send, then read
data.companyin the Response tab.

This completed company-page request costs 1 credit. Check data.lookupStatus before reading data.company or data.metrics. Company names use company.name, while person names use profile.fullName.
For the Node.js tab below, save linkedin-company.mjs and run node linkedin-company.mjs. For the TypeScript SDK tab, save linkedin-company.mts and run npx tsx linkedin-company.mts. Use the same environment variable and dependencies as the person example; both extensions explicitly select ES modules.
const params = new URLSearchParams({"url":"https://www.linkedin.com/company/microsoft"});
const response = await fetch(
`https://api.socialfetch.dev/v1/linkedin/companies?${params.toString()}`,
{
headers: {
"x-api-key": process.env.SOCIALFETCH_API_KEY,
},
}
);
const body = await response.json();
console.log(response.status, body);Schools and other organisation types use the v2 organisation lookup, which has its own parameters and price. Resolve a slug with Resolve organisation when you need an organisation ID. Do not send a school URL to the company-page route.
Save company research rows
Keep the fields your research needs, along with the collection time and request ID. Here are selected fields from real Microsoft, Stripe, Notion and Figma lookups. These are snapshots of what LinkedIn reported when collected.

This Python script makes one company request and writes a CSV file. It uses the standard library, so no extra Python package is needed. Set SOCIALFETCH_API_KEY, save the script as company_research.py, then run python company_research.py. Each completed run costs 1 credit.
Review returned external URLs before using them in your own app. A website field is reported page data, not a verification that a destination belongs to the company. Collect only the information you need and avoid copying featured employees into a company research table.
FAQ
Do I need to sign in to LinkedIn?
These requests use your Social Fetch key. They do not need LinkedIn cookies or a LinkedIn sign-in, and they do not unlock private content. Check the terms and permissions that apply to your collection and use of the data.
Can I search for people instead of supplying a handle?
Use Search people with supported filters, such as keyword. The live v2 search costs 8 credits per completed page, including empty pages. Its paging parameters differ from a profile lookup; follow the operation reference before adding a loop.
Why are some fields empty?
A found profile can still have null fields. That response did not report a value; leave it empty rather than guessing. A null profile with not_found means no profile was returned for that lookup.
How fresh is the data?
These examples use the live profile route and company-page route. Save when you collected each response and keep meta.requestId for support. Do not promise that every field is complete or that two lookups will return identical values.
How do I check what I spent?
Read meta.creditsCharged on each response. A completed person lookup costs 3 credits, and this company-page lookup costs 1 credit. A completed miss is still charged. The Usage page lets you review requests; see Credits for billing rules.