{"id":30598338,"url":"https://github.com/transitive-bullshit/linkedin-api","last_synced_at":"2025-08-29T22:13:41.334Z","repository":{"id":262047563,"uuid":"865159808","full_name":"transitive-bullshit/linkedin-api","owner":"transitive-bullshit","description":"👨‍💼 LinkedIn API for TypeScript","archived":false,"fork":false,"pushed_at":"2025-07-18T18:12:26.000Z","size":126,"stargazers_count":47,"open_issues_count":2,"forks_count":7,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-09T09:57:13.285Z","etag":null,"topics":["linkedin","linkedin-api"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/transitive-bullshit.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/funding.yml","license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["transitive-bullshit"]}},"created_at":"2024-09-30T04:46:10.000Z","updated_at":"2025-08-03T18:01:33.000Z","dependencies_parsed_at":"2024-11-10T06:44:24.424Z","dependency_job_id":"4245f11c-62e7-4d7a-b424-ed9d044417a6","html_url":"https://github.com/transitive-bullshit/linkedin-api","commit_stats":null,"previous_names":["transitive-bullshit/linkedin-api"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/transitive-bullshit/linkedin-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transitive-bullshit%2Flinkedin-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transitive-bullshit%2Flinkedin-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transitive-bullshit%2Flinkedin-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transitive-bullshit%2Flinkedin-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/transitive-bullshit","download_url":"https://codeload.github.com/transitive-bullshit/linkedin-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transitive-bullshit%2Flinkedin-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272772776,"owners_count":24990514,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-29T02:00:10.610Z","response_time":87,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["linkedin","linkedin-api"],"created_at":"2025-08-29T22:13:40.770Z","updated_at":"2025-08-29T22:13:41.323Z","avatar_url":"https://github.com/transitive-bullshit.png","language":"TypeScript","funding_links":["https://github.com/sponsors/transitive-bullshit"],"categories":[],"sub_categories":[],"readme":"# linkedin-api-fetch \u003c!-- omit from toc --\u003e\n\n\u003e TypeScript client for LinkedIn's unofficial API.\n\n\u003cp\u003e\n  \u003ca href=\"https://github.com/transitive-bullshit/linkedin-api/actions/workflows/main.yml\"\u003e\u003cimg alt=\"Build Status\" src=\"https://github.com/transitive-bullshit/linkedin-api/actions/workflows/main.yml/badge.svg\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/linkedin-api-fetch\"\u003e\u003cimg alt=\"NPM\" src=\"https://img.shields.io/npm/v/linkedin-api-fetch.svg\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/transitive-bullshit/linkedin-api/blob/main/license\"\u003e\u003cimg alt=\"MIT License\" src=\"https://img.shields.io/badge/license-MIT-blue\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://prettier.io\"\u003e\u003cimg alt=\"Prettier Code Formatting\" src=\"https://img.shields.io/badge/code_style-prettier-brightgreen.svg\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n- [Intro](#intro)\n- [Install](#install)\n- [Usage](#usage)\n  - [Authentication](#authentication)\n  - [Rate Limiting](#rate-limiting)\n  - [Proxies](#proxies)\n- [Troubleshooting](#troubleshooting)\n  - [`CHALLENGE` Errors](#challenge-errors)\n  - [401 Errors](#401-errors)\n- [TODO](#todo)\n- [Disclaimer](#disclaimer)\n- [License](#license)\n\n## Intro\n\nThis package provides a HTTP API client for accessing LinkedIn's readonly Voyager APIs. These are the same APIs that the official LinkedIn webapp uses to fetch data about user profiles, companies, and jobs.\n\nNo official API access is required. All you need is a valid LinkedIn user account (email and password).\n\n\u003e [!IMPORTANT]\n\u003e This library is not officially supported by LinkedIn. Using this library might violate LinkedIn's Terms of Service. Use it at your own risk.\n\n## Install\n\n```sh\nnpm install linkedin-api-fetch\n```\n\n## Usage\n\n```ts\nimport { LinkedInClient } from 'linkedin-api-fetch'\n\nconst linkedin = new LinkedInClient({\n  email: 'todo@example.com', // defaults to LINKEDIN_EMAIL\n  password: 'todo' // defaults to LINKEDIN_PASSWORD\n})\n\nconst user = await linkedin.getProfile('fisch2')\nconst company = await linkedin.getCompany('microsoft')\nconst school = await linkedin.getSchool('brown-university')\n\nconst peopleSearchResults = await linkedin.searchPeople('travis fischer')\nconst companySearchResults = await linkedin.searchCompanies('openai')\n```\n\nLinkedIn's internal data format is pretty verbose, so these methods all normalize the raw responses into a more reasonable format. Most API methods include a `Raw` version to return the original data: `getProfileRaw`, `getCompanyRaw`, `getSchoolRaw`, etc.\n\n### Authentication\n\n`LinkedInClient` will authenticate lazily using the provided email and password, or you can authenticate eagerly by calling `LinkedInClient.ensureAuthenticated()`.\n\nThe resulting cookies are stored using [conf](https://github.com/sindresorhus/conf) in a platform-dependent user data directory. You can access the cookie data via `linkedin.config.path` which will point to a path on your filesystem.\n\nAuth cookies are re-initialized automatically either when they expire or when the client runs into a `401`/`403` HTTP error. You can force the auth cookie to refresh manually by calling `linkedin.authenticate()` which returns a `Promise`.\n\nIf you want to force re-authentication and ignore the existing cookies, use `LinkedInClient.authenticate()`.\n\n\u003e [!IMPORTANT]\n\u003e I recommend not using your personal LinkedIn account credentials with any LinkedIn scraping library unless you don't care about the possibility of being banned. Create a throwaway account for testing purposes.\n\n### Rate Limiting\n\nIt is highly recommended that you throttle your API requests to LinkedIn to avoid being blocked. The default `LinkedInClient` adds a random delay between 1-5 seconds before each API request in order to try and evade detection. The default throttle also enforces a low rate-limit. It's easy to customize this default rate limit by disabling the default `throttle` and overriding the default `ky` instance:\n\n```ts\nimport { LinkedInClient } from 'linkedin-api-fetch'\nimport pThrottle from 'p-throttle'\nimport throttleKy from 'throttle-ky'\nimport ky from 'ky'\n\n// Custom rate-limit allowing up to 1 request every 5 seconds\nconst throttle = pThrottle({\n  limit: 1,\n  interval: 5 * 1000\n})\n\nconst linkedin = new LinkedInClient({\n  // Override the default `ky` instance which all API requests will use\n  ky: throttleKy(ky, throttle),\n\n  // Disable the default throttling\n  throttle: false\n})\n```\n\n### Proxies\n\nThe easiest way to use a proxy with Node.js `fetch` is via undici's [EnvHttpProxyAgent](https://github.com/nodejs/undici/blob/main/docs/docs/api/EnvHttpProxyAgent.md), which will respect the `http_proxy`, `https_proxy`, and `no_proxy` environment variables.\n\n```sh\nnpm install undici\n```\n\n```ts\nimport { LinkedInClient } from 'linkedin-api-fetch'\nimport { EnvHttpProxyAgent } from 'undici'\nimport ky from 'ky'\n\nconst linkedin = new LinkedInClient({\n  ky: ky.extend({\n    dispatcher: new EnvHttpProxyAgent() as any\n  })\n})\n```\n\n## Troubleshooting\n\n### `CHALLENGE` Errors\n\nLinkedIn will sometimes respond to authentication requests with a Challenge URL. This can happen if LinkedIn suspects your account is being used programatically (possibly a combination of IP-based, usage-based, and/or workload-based).\n\nIf you get a `CHALLENGE` error, you'll need to manually log out and log back in to your account using a browser.\n\n**Known reasons for Challenge** include:\n\n- 2FA\n- Rate-limit - \"It looks like you’re visiting a very high number of pages on LinkedIn.\". Note - n=1 experiment where this page was hit after ~900 contiguous requests in a single session (within the hour) (these included random delays between each request), as well as a bunch of testing, so who knows the actual limit.\n\n### 401 Errors\n\nIf you get a 401 error when trying to authenticate, you likely need to log in via your browser. LinkedIn will sometimes see traffic as suspicious and require a combination of email code verification and CAPTCHA.\n\nOnce you can log in via a browser with being challenged with additional auth, then this library should be able to authenticate properly.\n\n## TODO\n\n- `searchJobs()`\n- port more methods from the python version https://github.com/tomquirk/linkedin-api\n\n## Disclaimer\n\nThis library is not endorsed or supported by LinkedIn. It is an unofficial library intended for educational purposes and personal use only. By using this library, you agree to not hold the author or contributors responsible for any consequences resulting from its usage.\n\n## License\n\nMIT © [Travis Fischer](https://x.com/transitive_bs)\n\nThis package is a TypeScript port of the popular [Python linkedin-api](https://github.com/tomquirk/linkedin-api).\n\nIf you found this project helpful, please consider starring it and [following me on Twitter](https://x.com/transitive_bs).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftransitive-bullshit%2Flinkedin-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftransitive-bullshit%2Flinkedin-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftransitive-bullshit%2Flinkedin-api/lists"}