Skip to main content

Getting LinkedIn Cookies

The API needs your LinkedIn Sales Navigator session cookies to authenticate requests on your behalf. This guide shows you how to extract them from your browser.

Which cookies you need

Two cookies are required:
Cookies are session-specific. They expire when your LinkedIn session ends (usually after a few hours to days). If the API returns 401 Authentication failed, your cookies have likely expired — re-extract them and try again.

Step-by-step: Chrome / Edge / Firefox

  1. Log in to LinkedIn Sales Navigator — open https://www.linkedin.com/sales in your browser and make sure you’re fully logged in.
  2. Open Developer Tools — press F12 (or Cmd+Option+I on Mac) to open DevTools.
  3. Go to Application > Cookies:
    • Chrome / Edge: Application tab → StorageCookieshttps://www.linkedin.com
    • Firefox: Storage tab → Cookieshttps://www.linkedin.com
  4. Find the two cookies:
    • Locate li_at in the cookie list and copy its Value
    • Locate JSESSIONID in the cookie list and copy its Value (including quotes)
  5. Build the cookie string — combine them in the format the API expects:
    For example:

Alternative: copy as cURL

A faster method if you’re comfortable with DevTools:
  1. Log in to LinkedIn Sales Navigator and navigate to a search page
  2. Open DevTools (F12) → Network tab
  3. Refresh the page
  4. Right-click any request to www.linkedin.comCopyCopy as cURL
  5. In the copied cURL command, find the -H 'cookie: ...' header — that entire string is your cookie value
The cookie string from this method includes all cookies, not just li_at and JSESSIONID. That’s fine — the API will extract what it needs.

Providing cookies to the API

You can send cookies in two formats: Pass the full cookie string in the cookies field:
If you’re reading cookies programmatically (e.g., from a JSON export), pass them as a list:

Troubleshooting

Next steps