linkedin-api 2.1.1__tar.gz → 2.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,52 +1,93 @@
1
1
  Metadata-Version: 2.1
2
- Name: linkedin_api
3
- Version: 2.1.1
4
- Summary: Python wrapper for the Linkedin API
2
+ Name: linkedin-api
3
+ Version: 2.2.1
4
+ Summary: LinkedIn API for Python
5
5
  Home-page: https://github.com/tomquirk/linkedin-api
6
- Author: Tom Quirk
7
- Author-email: tomquirkacc@gmail.com
8
6
  License: MIT
9
- Classifier: Programming Language :: Python :: 3
7
+ Keywords: linkedin,api,automation,scraper,bot,data,sdk,ai,integration,profiles,network,company
8
+ Author: Tom Quirk
9
+ Author-email: tom@codalabs.au
10
+ Maintainer: Tom Quirk
11
+ Maintainer-email: tom@codalabs.au
12
+ Requires-Python: >=3.10,<4.0
10
13
  Classifier: License :: OSI Approved :: MIT License
11
- Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Requires-Dist: beautifulsoup4 (>=4.12.3,<5.0.0)
19
+ Requires-Dist: lxml (>=5.3.0,<6.0.0)
20
+ Requires-Dist: requests (>=2.32.3,<3.0.0)
21
+ Project-URL: Documentation, https://linkedin-api.readthedocs.io
22
+ Project-URL: Repository, https://github.com/tomquirk/linkedin-api
12
23
  Description-Content-Type: text/markdown
13
- License-File: LICENSE
14
- Requires-Dist: requests
15
- Requires-Dist: beautifulsoup4
16
- Requires-Dist: lxml
17
24
 
18
- # Linkedin API for Python
25
+
26
+ <div align="center">
27
+
28
+ # LinkedIn API for Python
29
+ ![Build](https://img.shields.io/github/actions/workflow/status/tomquirk/linkedin-api/ci.yml?label=Build&logo=github) [![GitHub Release](https://img.shields.io/github/v/release/tomquirk/linkedin-api?label=Release&logo=python)](https://pypi.org/project/linkedin-api/) [![License](https://img.shields.io/badge/License-MIT-blue)](#license) [![Documentation](https://img.shields.io/github/v/release/tomquirk/linkedin-api?label=Docs&color=23cc71&logo=readthedocs)](https://linkedin-api.readthedocs.io) [![PyPI Downloads](https://img.shields.io/pypi/dm/linkedin-api?label=Downloads)](https://pypi.org/project/linkedin-api/)
30
+
31
+
32
+ Search profiles, send messages, find jobs and more in Python. No official API access required.
33
+
34
+ <p align="center">
35
+ <a href="https://linkedin-api.readthedocs.io">Documentation</a>
36
+ ·
37
+ <a href="#quick-start">Quick Start</a>
38
+ ·
39
+ <a href="#how-it-works">How it works</a>
40
+ </p>
41
+
42
+ </div>
43
+
44
+ <br>
19
45
 
20
46
  <h3 align="center">Sponsors</h3>
21
47
 
22
- <p align="center" style="margin-bottom:24px" >
23
- <a href="https://prospeo.io/api/linkedin-email-finder" target="_blank">
24
- <img height="45px" style="margin-right:24px" src="https://raw.githubusercontent.com/tomquirk/linkedin-api/master/assets/logos/prospeo.png" alt="Prospeo">
48
+ <p align="center" dir="auto" >
49
+ <a href="https://bit.ly/3AFPGZd" target="_blank">
50
+ <img height="45px" src="https://raw.githubusercontent.com/tomquirk/linkedin-api/master/assets/logos/proapis.png" alt="iScraper by ProAPIs">
25
51
  </a>
26
- <a href="https://nubela.co/proxycurl/?utm_campaign=influencer%20marketing&utm_source=github&utm_medium=social&utm_term=-&utm_content=tom%20quirk" target="_blank">
52
+ <a href="https://bit.ly/3SWnB63" target="_blank">
53
+ <img height="45px" src="https://raw.githubusercontent.com/tomquirk/linkedin-api/master/assets/logos/prospeo.png" alt="Prospeo">
54
+ </a>
55
+ <a href="https://bit.ly/3SRximo" target="_blank">
27
56
  <img height="45px" src="https://raw.githubusercontent.com/tomquirk/linkedin-api/master/assets/logos/proxycurl.png" alt="proxycurl">
28
57
  </a>
29
- </p>
30
-
31
- <p align="center">
32
- <a href="https://iscraper.io/" target="_blank">
33
- <img height="35px" src="https://raw.githubusercontent.com/tomquirk/linkedin-api/master/assets/logos/iscraper.png" alt="serpsbot">
58
+ <a href="https://bit.ly/3Mbksvd" target="_blank">
59
+ <img height="45px" src="https://raw.githubusercontent.com/tomquirk/linkedin-api/master/assets/logos/lix.png" alt="Lix">
60
+ </a>
61
+ <a href="https://bit.ly/3WOIMrX" target="_blank">
62
+ <img height="70px" src="https://raw.githubusercontent.com/tomquirk/linkedin-api/master/assets/logos/unipile.png" alt="Unipile">
63
+ </a>
64
+ <a href="https://bit.ly/4fUyE9J" target="_blank">
65
+ <img height="45px" src="https://raw.githubusercontent.com/tomquirk/linkedin-api/master/assets/logos/scrapin.png" alt="Scrapin">
34
66
  </a>
35
67
  </p>
36
68
 
37
- <h5 align="center"><a href="https://github.com/sponsors/tomquirk/sponsorships?sponsor=tomquirk&tier_id=96653&preview=false" target="_blank">Become a sponsor</a></h5>
69
+ <p align="center"><a href="https://bit.ly/4cCjbIq" target="_blank">Become a sponsor</a></p>
38
70
 
39
- ---
71
+ <br>
40
72
 
41
- Programmatically send messages, get jobs, and search profiles with a regular Linkedin user account.
73
+ ## Features
42
74
 
43
- No "official" API access required - just use a valid Linkedin account!
75
+ - ✅ No official API access required. Just use a valid LinkedIn user account.
76
+ - ✅ Direct HTTP API interface. No Selenium, Pupeteer, or other browser-based scraping methods.
77
+ - ✅ Get and search people, companies, jobs, posts
78
+ - ✅ Send and retrieve messages
79
+ - ✅ Send and accept connection requests
80
+ - ✅ Get and react to posts
44
81
 
45
- **Caution**: This library is not officially supported by LinkedIn. Using it might violate LinkedIn's Terms of Service. Use it at your own risk.
82
+ And more! [Read the docs](https://linkedin-api.readthedocs.io/en/latest/api.html) for all API methods.
46
83
 
47
84
  ## Installation
48
85
 
49
- > Python >= 3.6 required
86
+ > [!IMPORTANT]
87
+ > This library is not officially supported by LinkedIn. Using this might violate LinkedIn's Terms of Service. Use it at your own risk.
88
+
89
+ > [!NOTE]
90
+ > Python >= 3.8 required
50
91
 
51
92
  To install the linkedin_api package, use the following command:
52
93
 
@@ -62,6 +103,7 @@ pip install git+https://github.com/tomquirk/linkedin-api.git
62
103
 
63
104
  ### Quick Start
64
105
 
106
+ > [!TIP]
65
107
  > See all methods on the [documentation website](https://linkedin-api.readthedocs.io/).
66
108
 
67
109
  The following snippet demonstrates a few basic linkedin_api use cases:
@@ -82,6 +124,12 @@ contact_info = api.get_profile_contact_info('billy-g')
82
124
  connections = api.get_profile_connections('1234asc12304')
83
125
  ```
84
126
 
127
+ ## Documentation
128
+
129
+ For comprehensive documentation, including available methods and parameters, visit the [documentation](https://linkedin-api.readthedocs.io/).
130
+
131
+ [Learn more](#how-it-works) about how it works.
132
+
85
133
  ## Commercial alternatives
86
134
 
87
135
  > This is a sponsored section
@@ -132,13 +180,73 @@ Built for developers, by developers.
132
180
 
133
181
  </details>
134
182
 
135
- > End sponsored section
183
+ <h3>
184
+ <a href="https://www.unipile.com/communication-api/messaging-api/linkedin-api/?utm_campaign=git%20tom%20quirk">
185
+ Unipile
186
+ </a>
187
+ </h3>
136
188
 
137
- ## Documentation
189
+ Full [LinkedIn API](https://www.unipile.com/communication-api/messaging-api/linkedin-api/?utm_campaign=git%20tom%20quirk): Connect Classic/Sales Navigator/Recruiter, synchronize real-time messaging, enrich data and build outreach sequences…
138
190
 
139
- For comprehensive documentation, including available methods and parameters, visit the [documentation](https://linkedin-api.readthedocs.io/).
191
+ <details>
192
+ <summary>Learn more</summary>
193
+
194
+ - Easily connect your users in the cloud with our white-label authentication (captcha solving, in-app validation, OTP, 2FA).
195
+ - Real-time webhook for each message received, read status, invitation accepted, and more.
196
+ - Data extraction: get profile, get company, get post, extract search results from Classic + Sales Navigator + Recruiter
197
+ - Outreach sequences: send invitations, InMail, messages, and comment on posts…
140
198
 
141
- [Learn more](#how-it-works) about how it works.
199
+ Test [all the features](https://www.unipile.com/communication-api/messaging-api/linkedin-api/?utm_campaign=git%20tom%20quirk) with our 7-day free trial.
200
+
201
+ </details>
202
+
203
+ <h3>
204
+ <a href="https://bit.ly/4fUyE9J">
205
+ ScrapIn
206
+ </a>
207
+ </h3>
208
+
209
+ Scrape Any Data from LinkedIn, without limit with [ScrapIn API](https://bit.ly/4fUyE9J).
210
+
211
+ <details>
212
+ <summary>Learn more</summary>
213
+
214
+ - Real time data (no-cache)
215
+ - Built for SaaS developers
216
+ - GDPR, CCPA, SOC2 compliant
217
+ - Interactive API documentation
218
+ - A highly stable API, backed by over 4 years of experience in data provisioning, with the added reliability of two additional data provider brands owned by the company behind ScrapIn.
219
+
220
+ Try it for free. [Get your API key now](https://bit.ly/4fUyE9J)
221
+
222
+ </details>
223
+
224
+ <h3>
225
+ <a href="https://bit.ly/3AFPGZd">
226
+ iScraper by ProAPIs, Inc.
227
+ </a>
228
+ </h3>
229
+
230
+ Access high-quality, real-time LinkedIn data at scale with [iScraper API](https://bit.ly/3AFPGZd), offering unlimited scalability and unmatched accuracy.
231
+
232
+ <details>
233
+
234
+ <summary>Learn more</summary>
235
+
236
+ - Real-time LinkedIn data scraping with unmatched accuracy
237
+ - Hosted datasets with powerful Lucene search access
238
+ - Designed for enterprise and corporate-level applications
239
+ - Handles millions of scrapes per day, ensuring unlimited scalability
240
+ - Trusted by top enterprises for mission-critical data needs
241
+ - Interactive API documentation built on OpenAPI 3 specs for seamless integration
242
+ - Backed by over 10 years of experience in real-time data provisioning
243
+ - Lowest price guarantee for high volume use
244
+
245
+ Get started [here](https://bit.ly/3AFPGZd).
246
+
247
+ </details>
248
+
249
+ > End sponsored section
142
250
 
143
251
  ## Disclaimer
144
252
 
@@ -146,30 +254,30 @@ This library is not endorsed or supported by LinkedIn. It is an unofficial libra
146
254
 
147
255
  ## Contributing
148
256
 
149
- We welcome contributions! [Learn how to find endpoints](#to-find-endpoints)
257
+ We welcome contributions! [Learn how to find endpoints](#find-new-endpoints).
150
258
 
151
- ## Development Setup
259
+ ## Development
152
260
 
153
261
  ### Dependencies
154
262
 
155
263
  - Python 3.7
156
264
  - A valid Linkedin user account (don't use your personal account, if possible)
157
- - `pipenv` (optional)
265
+ - [`pipenv`](https://pipenv.pypa.io/en/latest/) (optional)
158
266
 
159
267
  ### Development installation
160
268
 
161
269
  1. Create a `.env` config file. An example is provided in `.env.example` - you include at least all of the settings set there.
162
- 2. Using pipenv...
270
+ 2. Install dependencies with `pipenv`:
163
271
 
164
272
  ```bash
165
273
  pipenv install --dev
166
274
  pipenv shell
167
275
  ```
168
276
 
169
- ### Running tests
277
+ ### Run tests
170
278
 
171
279
  ```bash
172
- python -m pytest tests
280
+ pipenv run test
173
281
  ```
174
282
 
175
283
  ### Troubleshooting
@@ -191,19 +299,17 @@ Please add more as you come across them.
191
299
 
192
300
  ## How it works
193
301
 
194
- > Before using this project, please consult the [Terms and Conditions](#terms-and-conditions) and [Legal Notice](#legal).
302
+ This project attempts to provide a simple Python interface for the LinkedIn API.
195
303
 
196
- This project attempts to provide a simple Python interface for the Linkedin API.
304
+ > Do you mean the [legit LinkedIn API](https://developer.linkedin.com/)?
197
305
 
198
- > Do you mean the [legit Linkedin API](https://developer.linkedin.com/)?
199
-
200
- NO! To retrieve structured data, the [Linkedin Website](https://linkedin.com) uses a service they call **Voyager**. Voyager endpoints give us access to pretty much everything we could want from Linkedin: profiles, companies, connections, messages, etc. - anything that you can see on linkedin.com, we can get from Voyager.
306
+ NO! To retrieve structured data, the [LinkedIn Website](https://linkedin.com) uses a service they call **Voyager**. Voyager endpoints give us access to pretty much everything we could want from LinkedIn: profiles, companies, connections, messages, etc. - anything that you can see on linkedin.com, we can get from Voyager.
201
307
 
202
308
  This project aims to provide complete coverage for Voyager.
203
309
 
204
- [How does it work?](#in-depth-overview)
310
+ [How does it work?](#deep-dive)
205
311
 
206
- ### In-depth overview
312
+ ### Deep dive
207
313
 
208
314
  Voyager endpoints look like this:
209
315
 
@@ -221,17 +327,17 @@ https://www.linkedin.com/voyager/api /identity/profileView/tom-quirk
221
327
 
222
328
  They are authenticated with a simple cookie, which we send with every request, along with a bunch of headers.
223
329
 
224
- To get a cookie, we POST a given username and password (of a valid Linkedin user account) to `https://www.linkedin.com/uas/authenticate`.
330
+ To get a cookie, we POST a given username and password (of a valid LinkedIn user account) to `https://www.linkedin.com/uas/authenticate`.
225
331
 
226
- ### To find endpoints
332
+ ### Find new endpoints
227
333
 
228
- We're looking at the Linkedin website and we spot some data we want. What now?
334
+ We're looking at the LinkedIn website and we spot some data we want. What now?
229
335
 
230
- The most reliable method to find the relevant endpoint is to:
336
+ The following describes the most reliable method to find relevant endpoints:
231
337
 
232
338
  1. `view source`
233
- 2. `command-f`/search the page for some keyword in the data. This will exist inside of a `<code>` tag.
234
- 3. Scroll down to the **next adjacent element** which will be another `<code>` tag, probably with an `id` that looks something like
339
+ 1. `command-f`/search the page for some keyword in the data. This will exist inside of a `<code>` tag.
340
+ 1. Scroll down to the **next adjacent element** which will be another `<code>` tag, probably with an `id` that looks something like
235
341
 
236
342
  ```html
237
343
  <code style="display: none" id="datalet-bpr-guid-3900675">
@@ -239,13 +345,13 @@ The most reliable method to find the relevant endpoint is to:
239
345
  </code>
240
346
  ```
241
347
 
242
- 4. The value of `request` is the url! 🤘
348
+ The value of `request` is the url! 🤘
243
349
 
244
350
  You can also use the `network` tab in you browsers developer tools, but you will encounter mixed results.
245
351
 
246
352
  ### How Clients query Voyager
247
353
 
248
- linkedin.com queries data using the [Rest-li Protocol](https://linkedin.github.io/rest.li/spec/protocol). Rest-li is an internal query language/syntax where clients (like linkedin.com) to specify what data they want (similar to the GraphQL concept).
354
+ linkedin.com uses the [Rest-li Protocol](https://linkedin.github.io/rest.li/spec/protocol) for querying data. Rest-li is an internal query language/syntax where clients (like linkedin.com) specify what data they want. It's conceptually similar to the GraphQL.
249
355
 
250
356
  Here's an example of making a request for an organisation's `name` and `groups` (the Linkedin groups it manages):
251
357
 
@@ -253,7 +359,7 @@ Here's an example of making a request for an organisation's `name` and `groups`
253
359
  /voyager/api/organization/companies?decoration=(name,groups*~(entityUrn,largeLogo,groupName,memberCount,websiteUrl,url))&q=universalName&universalName=linkedin
254
360
  ```
255
361
 
256
- The "querying" happens in the `decoration` parameter, which looks like
362
+ The "querying" happens in the `decoration` parameter, which looks like the following:
257
363
 
258
364
  ```text
259
365
  (
@@ -262,7 +368,7 @@ The "querying" happens in the `decoration` parameter, which looks like
262
368
  )
263
369
  ```
264
370
 
265
- So here, we request an organisation name, and a list of groups, where for each group we want `largeLogo`, `groupName`, etc.
371
+ Here, we request an organisation name and a list of groups, where for each group we want `largeLogo`, `groupName`, and so on.
266
372
 
267
373
  Different endpoints use different parameters (and perhaps even different syntaxes) to specify these queries. Notice that the above query had a parameter `q` whose value was `universalName`; the query was then specified with the `decoration` parameter.
268
374
 
@@ -274,8 +380,9 @@ List(v->PEOPLE)
274
380
 
275
381
  It could be possible to document (and implement a nice interface for) this query language - as we add more endpoints to this project, I'm sure it will become more clear if such a thing would be possible (and if it's worth it).
276
382
 
277
- ### Releasing a new version
383
+ ### Release a new version
278
384
 
279
385
  1. Bump `__version__` in `__init__.py`
280
- 1. `python3 setup.py sdist bdist_wheel`
281
- 1. `python3 -m twine upload dist/*`
386
+ 1. `pipenv run build`
387
+ 1. `pipenv run publish`
388
+