Guide
How to Pull LinkedIn Profiles into n8n with an API, Node by Node
A node-by-node n8n workflow for teams that want LinkedIn profiles in their automations: one HTTP Request to start a search, a Wait and If loop until it finishes, and a cursor loop that writes every profile to a sheet.
Last updated · 7 min read
An n8n LinkedIn scraper is a workflow that calls a LinkedIn profile API with n8n's HTTP Request node and writes the returned profiles to a sheet, a database or another app. Because profile searches take time, the workflow has four parts: an HTTP Request that starts the search, a Wait and If loop that checks the run until it finishes, a second loop that reads the result pages with a cursor, and a Split Out node that turns each page into one item per profile. Nothing in the workflow logs in to LinkedIn or runs a browser; the API does the collection, and n8n only orchestrates the calls.
What is an n8n LinkedIn scraper?
An n8n LinkedIn scraper is an n8n workflow that retrieves LinkedIn profile data as structured fields, usually by calling a profile API over HTTP, so the data can feed later nodes such as a spreadsheet, a CRM or a notification. The workflow defines the search, waits for the results and maps each profile's fields to the destination.
According to n8n's documentation, the HTTP Request node makes HTTP requests to query data from any app or service with a REST API, and it supports generic credentials for authentication. That makes it the usual building block when a service has no dedicated n8n node: the workflow sends the same requests a script would, configured in fields instead of code.
The n8n nodes a LinkedIn profile workflow needs
A LinkedIn profile workflow in n8n needs six kinds of nodes: a trigger, HTTP Request nodes for the API calls, a Wait node between status checks, If nodes to decide when a loop stops, a Split Out node to turn a page into items, and a destination node. The table lists each one with its role in the workflow below.
| Node | Name in the workflow | Role | Key setting |
|---|---|---|---|
| A trigger node | Start | Starts the workflow | A schedule or a manual run |
| HTTP Request | Create search | Starts a paid search run | POST, Bearer auth, Idempotency-Key header |
| Wait | Wait | Pauses between status checks | After Time Interval, 20 seconds |
| HTTP Request | Check run | Reads the run status | GET /v1/runs/{run_id} |
| If | Finished? / Succeeded? / More pages? | Ends or repeats a loop | A boolean expression |
| HTTP Request | First page / Next page | Reads profiles | limit and cursor query parameters |
| Split Out | One item per profile | Separates the data list |
Field to Split Out: data |
| Google Sheets | Append profiles | Writes the rows | Operation: Append Row |
n8n's documentation on loops says to connect the output of one node to the input of a previous node and add an If node to check when to stop, which is how both loops in this workflow are built.
How to pull LinkedIn profiles into n8n step by step
To pull LinkedIn profiles into n8n, store the API key as a credential, create the search with an HTTP Request node, loop a Wait node and a status check until the run finishes, read the first page, loop through the remaining pages with next_cursor, and send each profile to the destination. The six steps below use pineapi, a LinkedIn profile API that bills per profile delivered.
pineapi has no dedicated n8n node, so every call goes through the HTTP Request node. In the configuration blocks, $PINEAPI_BASE_URL stands for the API host you receive at sign-up and $PINEAPI_KEY for your key; the same requests as curl commands are in the pineapi quickstart.
Step 1: Store the API key as a Bearer auth credential
The pineapi key goes into an n8n credential so it never appears in a node field. n8n's HTTP Request credentials include a generic Bearer auth type, which n8n describes as header authentication with the name Authorization and the value Bearer <token>. pineapi expects exactly that header and never asks for a LinkedIn login or session cookie.
Credential type: Bearer Auth (generic credential type)
Bearer Token: $PINEAPI_KEYStep 2: Create the search with an HTTP Request node
The Create search node sends POST /v1/profile-searches with the filters as a JSON body, and pineapi answers HTTP 202 with a run_id instead of the profiles. The Idempotency-Key header is required; using n8n's $execution.id, which n8n documents as the unique ID of the current workflow execution, means a retry inside one execution never starts a second paid search.
This node is paid. Each delivered profile costs $0.010 and every search has a $0.12 floor, so max_items of 100 costs at most $1.00. Location values come from /v1/catalogs/locations.
Node: HTTP Request — "Create search"
Method: POST
URL: $PINEAPI_BASE_URL/v1/profile-searches
Authentication: Generic Credential Type → Bearer Auth (Step 1)
Send Headers: Idempotency-Key = {{ $execution.id }}
Send Body: JSON
Body: {"current_job_titles": ["Product Designer"], "locations": ["Amsterdam"], "max_items": 100}Step 3: Loop a Wait node until the run finishes
A pineapi run is checked with GET /v1/runs/{run_id} until the status reaches one of four final values: succeeded, partial, failed or cancelled. pineapi's documentation recommends a 5-second interval during the first minute, then 20 seconds between checks, and a fixed 20-second Wait never checks more often than that.
For waits under 65 seconds, n8n's Wait node documentation says the process keeps running and resumes after the interval instead of saving the execution to the database. The loop is Wait → Check run → Finished?, with the false output of Finished? connected back to Wait:
Node: Wait — "Wait"
Resume: After Time Interval
Amount: 20 Unit: Seconds
Node: HTTP Request — "Check run"
Method: GET
URL: $PINEAPI_BASE_URL/v1/runs/{{ $('Create search').first().json.run_id }}
Node: If — "Finished?"
Condition: {{ ["succeeded", "partial", "failed", "cancelled"].includes($json.status) }} is true
false → Wait
true → If "Succeeded?": {{ ["succeeded", "partial"].includes($json.status) }}A partial run is a normal end: fewer profiles arrived than were requested, and only those are billed. failed and cancelled runs are not billed, so the false output of Succeeded? can simply end the workflow or send an alert.
Step 4: Read the first page of profiles
Once a pineapi run has finished, its profiles come from GET /v1/runs/{run_id}/profiles page by page; every page contains data, has_more and next_cursor, and reading a page costs nothing, so the page nodes can be run again on the same run_id within the 30 days pineapi keeps the results without starting a new search.
Node: HTTP Request — "First page"
Method: GET
URL: $PINEAPI_BASE_URL/v1/runs/{{ $('Create search').first().json.run_id }}/profiles
Query Parameters: limit = 200Connect First page to two nodes: the Split Out node from Step 6 and an If node named More pages? with the condition {{ $json.has_more }} is true.
Step 5: Loop through the remaining pages with next_cursor
Each further page is requested by sending the previous page's next_cursor as the cursor parameter until has_more is false; pineapi has no offset parameter. In n8n that is a second loop: More pages? → Next page → More pages?, with Next page also connected to Split Out.
Node: HTTP Request — "Next page"
Method: GET
URL: $PINEAPI_BASE_URL/v1/runs/{{ $('Create search').first().json.run_id }}/profiles
Query Parameters: limit = 200
cursor = {{ $json.next_cursor }}
Outputs to: Split Out and More pages?The true output of More pages? goes to Next page; the false output is left unconnected, which ends the loop once the last page has been read.
Step 6: Split the profiles and write them to Google Sheets
n8n's Split Out node separates a list field into individual items, so setting Field to Split Out to data turns each page into one item per profile. A Google Sheets node with the Append Row operation, which n8n documents as appending a new row at the end of the data in a sheet, then writes one row per item.
Node: Split Out — "One item per profile"
Field to Split Out: data
Node: Google Sheets — "Append profiles"
Operation: Append Row
Columns: full_name, headline, current_title, current_company_name,
location_text, linkedin_url, experience_truncatedEach pineapi profile has 53 fields and 16 nested collections and no email address; experience_truncated and skills_truncated mark profiles whose sections LinkedIn served only in part. Teams that prefer code over nodes can follow the Python version of this workflow.
Polling vs webhook_url in an n8n workflow
Polling the run with an authenticated GET is the reliable way for an n8n workflow to learn that a pineapi run has finished. pineapi also accepts a webhook_url that receives run metadata, but its signing secret is not yet available to customers, so an n8n Webhook trigger cannot verify that a call really came from pineapi.
| Approach | How n8n learns the run finished | Can the workflow verify it? | Use it for |
|---|---|---|---|
Polling GET /v1/runs/{run_id} |
The workflow asks with its own key | Yes, the request is authenticated | Deciding to read and write the profiles |
webhook_url |
pineapi calls an n8n Webhook node | Not yet, no signing secret for customers | At most a hint to check the run sooner |
A workflow that does start from a webhook should still call GET /v1/runs/{run_id} with its key before reading profiles, so the authenticated status stays the source of truth.
What an n8n LinkedIn workflow costs to run
An n8n LinkedIn workflow built on pineapi costs only the profiles it receives: $0.010 per profile delivered, a $0.12 minimum per search, and nothing for status checks, page reads or failed runs. A finished search that matches nobody is still billed the $0.12 minimum, and pineapi has no subscription, with prepaid balance from $5.
The maximum cost of one execution is max_items × $0.010, so it is worth setting max_items in the Create search node rather than relying on the filters to keep a run small. pineapi's brief for AI assistants on the use-with-AI page asks the assistant to confirm any run above $5 before starting it, a threshold that also works as a manual review rule for scheduled workflows. When balance runs out, pineapi answers insufficient_balance instead of charging more, which caps what a misconfigured schedule can spend.