Guide
How to Enrich Your CRM with LinkedIn Profile Data from a List of URLs
A five-step guide for developers and operations teams whose CRM already holds LinkedIn URLs: normalise the list, look the profiles up in bulk, match every result to its row and decide when a refresh is worth paying for.
Last updated · 7 min read
LinkedIn data enrichment fills empty or outdated fields in a CRM or database, such as job title, company, location and skills, from the LinkedIn profile each record already links to. The reliable workflow has five steps: normalise and deduplicate the stored URLs, look the profiles up in bulk, match every result back to its row by the URL you sent, record the URLs that did not resolve, and write the fields with the date they were read. The join key matters more than the lookup itself, because a member who changes their profile slug comes back under a new URL.
What is LinkedIn data enrichment?
LinkedIn data enrichment is the process of adding professional details from LinkedIn profiles to records you already hold, using each record's LinkedIn profile URL as the input. The output is the same record with current role, employer, location, experience and skills filled in or corrected.
Enrichment differs from prospecting: prospecting finds new people, while enrichment completes people already in the CRM. A recruiting agency with 5,000 candidates whose rows hold only a name and a LinkedIn URL is the typical case: the URLs are known, and the job is to turn each one into structured fields without retyping anything.
Which CRM fields LinkedIn profile data can fill
LinkedIn profile data can fill the work fields of a CRM contact: job title, company, company LinkedIn page, location, headline, time in role, total experience and skills. It cannot fill contact details, because a LinkedIn profile response from pineapi carries 53 fields and 16 nested collections and no email address or phone number.
| CRM field | Profile field in pineapi | Note |
|---|---|---|
| Job title | current_title |
The member's current role |
| Company | current_company_name |
Pair with the next row to avoid name clashes |
| Company LinkedIn page | current_company_linkedin_url |
Useful for matching contacts to accounts |
| Location and country | location_text, location_country_code |
Text for display, code for filters |
| Headline | headline |
The member's own one-line summary |
| In current role since | current_position_started_on |
A date, so the CRM can compute tenure |
| Years of experience | total_months_experience |
A lower bound when experience_truncated is true |
| Skills | skills_flat |
A list; many CRMs store it as text |
| Current LinkedIn URL | linkedin_url |
Display only; can differ from the stored URL |
| Email and phone | not returned | Needs a separate contact-data provider |
Filling an email or a phone number is a different job: HappySales explains how waterfall enrichment asks one provider after another until one returns the missing field. Types and descriptions for each field are documented on the pineapi LinkedIn scraper API page.
How to enrich CRM records from LinkedIn URLs
To enrich CRM records from LinkedIn URLs, export the URLs with their record IDs, normalise them into a matching key, send them to a profile lookup in batches, join the results back by that key, and write the fields. The five steps below are complete Python for a CRM or database that can export and import rows.
Step 1: Normalise and deduplicate the LinkedIn URLs
CRM data often holds the same LinkedIn URL in several spellings: with or without a trailing slash, with tracking parameters, or with http instead of https. A matching key built from the path alone makes those spellings equal, so duplicates are removed before the lookup and every result finds its row afterwards.
This code builds the key, keeps one URL per key and remembers every record that shares it:
from collections import defaultdict
from urllib.parse import urlsplit
def url_key(url):
return urlsplit((url or "").strip()).path.rstrip("/").lower()
rows = [{"record_id": "C-1001", "linkedin": "https://www.linkedin.com/in/<slug>/"}] # your CRM export
records_by_key, url_by_key = defaultdict(list), {}
for row in rows:
key = url_key(row["linkedin"])
records_by_key[key].append(row["record_id"])
url_by_key.setdefault(key, row["linkedin"])
urls = list(url_by_key.values())The pineapi lookup also normalises and deduplicates the list it receives, but a key you own is what lets two CRM records with one profile both get the update.
Step 2: Look up the LinkedIn profiles in batches of up to 2,000
A pineapi profile lookup, POST /v1/profile-lookups, takes a list of between 1 and 2,000 profile URLs in a single request, and its results use the same schema as a filter search. The lookup is asynchronous: the response is HTTP 202 carrying a run_id, and the script checks GET /v1/runs/{run_id} until the run ends. URL lookups usually finish in seconds, according to pineapi's documentation, which does not promise a time.
This request is paid. A lookup has no minimum and bills $0.010 per profile delivered, and URLs that do not resolve cost nothing, so a batch of 2,000 URLs costs at most 2,000 × $0.010. This function runs one batch and returns the profiles and the unresolved URLs:
import os, time, uuid
import requests
V1 = os.environ["PINEAPI_BASE_URL"].rstrip("/") + "/v1"
client = requests.Session()
client.headers["Authorization"] = f"Bearer {os.environ['PINEAPI_KEY']}"
def get(path, **kw):
r = client.get(V1 + path, timeout=30, **kw)
r.raise_for_status()
return r.json()
def lookup_batch(batch):
r = client.post(V1 + "/profile-lookups", json={"linkedin_urls": batch}, timeout=30,
headers={"Idempotency-Key": str(uuid.uuid4())})
r.raise_for_status()
run_id, t0 = r.json()["run_id"], time.monotonic()
while (run := get(f"/runs/{run_id}"))["status"] not in {"succeeded", "partial", "failed", "cancelled"}:
time.sleep(5 if time.monotonic() - t0 < 60 else 20)
if run["status"] in {"failed", "cancelled"}:
raise RuntimeError(f"run {run_id} {run['status']}")
found, params = [], {"limit": 200}
while True:
page = get(f"/runs/{run_id}/profiles", params=params)
found += page["data"]
if not page["has_more"]:
return found, run["unresolved"]
params["cursor"] = page["next_cursor"]
profiles, unresolved = [], []
for i in range(0, len(urls), 2000):
found, missing = lookup_batch(urls[i:i + 2000])
profiles += found
unresolved += missingStep 3: Match each profile to its CRM row with requested_url
Each profile from a pineapi lookup carries requested_url, the URL that produced it, and that field is the join key back to the CRM. linkedin_url is not safe for joining, because it shows the member's current slug, which can differ from the one stored in the CRM.
This code applies the same url_key to requested_url and collects one update per CRM record:
updates = {}
for p in profiles:
for record_id in records_by_key[url_key(p["requested_url"])]:
updates[record_id] = {
"job_title": p.get("current_title"),
"company": p.get("current_company_name"),
"company_linkedin": p.get("current_company_linkedin_url"),
"country": p.get("location_country_code"),
"months_experience": p.get("total_months_experience"),
"experience_truncated": p.get("experience_truncated"),
"linkedin_read_at": p.get("scraped_at"),
}The same matching rules are also set out in pineapi's URL reconciliation guide.
Step 4: Record unresolved LinkedIn URLs instead of overwriting the row
A LinkedIn URL that pineapi cannot turn into a profile comes back in the run's unresolved list with requested_url and a reason: not_found means the profile does not exist or its slug has changed, and unavailable means a later retry may work. Neither is billed.
An unresolved URL should never blank out fields the CRM already has. Write the reason to a status field instead, retry unavailable rows in the next batch and send not_found rows to a person who can find the new URL:
status = {rid: "enriched" for rid in updates}
for item in unresolved:
for record_id in records_by_key[url_key(item["requested_url"])]:
status[record_id] = "retry" if item["reason"] == "unavailable" else "url_not_found"Step 5: Write the fields and keep the read date
The last step writes updates and status back to the CRM through its import or API, together with the date each profile was read. pineapi keeps a run's results for 30 days and re-downloading them in that period is free, so a failed import can be repeated from the same run without a new lookup.
Writing only non-empty values keeps a member's blank LinkedIn field from erasing data a salesperson entered by hand. CRM-specific steps, such as a unique property for the URL and batched upserts, are covered in the guide to syncing LinkedIn profiles into HubSpot.
What LinkedIn data enrichment costs with a lookup API
LinkedIn data enrichment with pineapi costs $0.010 per profile delivered, with no minimum for a URL lookup and no subscription. URLs that do not resolve are free, a duplicate inside one run is discarded without charge, and checking a run or downloading its results again costs nothing.
pineapi's published examples give the scale: sending 100 URLs and getting 80 profiles back is billed $0.80, since the 20 URLs without a profile are not charged, and 10,000 profiles cost $100. For any other list, the cost is the number of profiles delivered × $0.010. Balance is prepaid from $5, and when it runs out the API answers insufficient_balance instead of spending more.
How often to refresh enriched LinkedIn data
Refresh enriched LinkedIn data when its age starts to matter for the work the CRM supports, not on a fixed schedule for every row. In pineapi, the same profile delivered in a different run is billed again, so refreshing 10,000 profiles costs $100 again, the same as the first enrichment.
A cheaper rule refreshes only what is about to be used or has gone stale: rows older than your own threshold, according to the stored read date, and the rows in a campaign or shortlist about to start. Rows marked retry go into the next batch; rows marked url_not_found wait until someone supplies a new URL, since not_found means the profile is gone or its slug has changed.
What the GDPR asks of a CRM enriched with LinkedIn data
Under the EU GDPR, adding LinkedIn data to a CRM record is processing personal data, so the company running the enrichment needs its own lawful basis. pineapi is not affiliated with LinkedIn and does not provide that basis; choosing one and informing people under Article 14 are covered in the article on whether LinkedIn scraping is legal.
Enrichment also touches the accuracy principle. Article 5(1)(d) of the GDPR requires personal data to be "accurate and, where necessary, kept up to date", and Article 16 gives people the right to have inaccurate data rectified without undue delay. A stored read date on every enriched record, and a refresh rule for the records in use, help a team show how it keeps that data current and correct it when asked.