Coder Social home page Coder Social logo

linkedin-api's Introduction

Linkedin API for Python

Sponsors

Prospeo proxycurl Lix

serpsbot


Programmatically search profiles, send messages, and find jobs. All with a regular Linkedin user account.

No "official" API access required - just use a valid Linkedin account!

Caution: This library is not officially supported by LinkedIn. Using it might violate LinkedIn's Terms of Service. Use it at your own risk.

Installation

Python >= 3.6 required

To install the linkedin_api package, use the following command:

pip install linkedin-api

Or, for bleading edge:

pip install git+https://github.com/tomquirk/linkedin-api.git

Quick Start

See all methods on the documentation website.

The following snippet demonstrates a few basic linkedin_api use cases:

from linkedin_api import Linkedin

# Authenticate using any Linkedin account credentials
api = Linkedin('[email protected]', '*******')

# GET a profile
profile = api.get_profile('billy-g')

# GET a profiles contact info
contact_info = api.get_profile_contact_info('billy-g')

# GET 1st degree connections of a given profile
connections = api.get_profile_connections('1234asc12304')

Commercial alternatives

This is a sponsored section

Extract data and find verified emails in real-time with Prospeo LinkedIn Email Finder API.

Learn more Submit a LinkedIn profile URL to our API and get:
  • Profile data extracted in real-time
  • Company data of the profile
  • Verified work email of the profile
  • Exclusive data points (gender, cleaned country code, time zone...)
  • One do-it-all request
  • Stable API, tested under high load

Try it with 75 profiles. Get your FREE API key now.

Scrape public LinkedIn profile data at scale with Proxycurl APIs.

Learn more
  • Scraping Public profiles are battle tested in court in HiQ VS LinkedIn case.
  • GDPR, CCPA, SOC2 compliant
  • High rate limit - 300 requests/minute
  • Fast - APIs respond in ~2s
  • Fresh data - 88% of data is scraped real-time, other 12% are not older than 29 days
  • High accuracy
  • Tons of data points returned per profile

Built for developers, by developers.

End sponsored section

Documentation

For comprehensive documentation, including available methods and parameters, visit the documentation.

Learn more about how it works.

Disclaimer

This 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.

Contributing

We welcome contributions! Learn how to find endpoints.

Development

Dependencies

  • Python 3.7
  • A valid Linkedin user account (don't use your personal account, if possible)
  • pipenv (optional)

Development installation

  1. Create a .env config file. An example is provided in .env.example - you include at least all of the settings set there.

  2. Install dependencies with pipenv:

    pipenv install --dev
    pipenv shell

Run tests

pipenv run test

Troubleshooting

I keep getting a CHALLENGE

Linkedin will throw you a curve ball in the form of a Challenge URL. We currently don't handle this, and so you're kinda screwed. We think it could be only IP-based (i.e. logging in from different location). Your best chance at resolution is to log out and log back in on your browser.

Known reasons for Challenge include:

  • 2FA
  • 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.

Please add more as you come across them.

Search problems

  • Mileage may vary when searching general keywords like "software" using the standard search method. They've recently added some smarts around search whereby they group results by people, company, jobs etc. if the query is general enough. Try to use an entity-specific search method (i.e. search_people) where possible.

How it works

This project attempts to provide a simple Python interface for the Linkedin API.

Do you mean the legit Linkedin API?

NO! To retrieve structured data, the Linkedin Website 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.

This project aims to provide complete coverage for Voyager.

How does it work?

Deep dive

Voyager endpoints look like this:

https://www.linkedin.com/voyager/api/identity/profileView/tom-quirk

Or, more clearly

 ___________________________________ _______________________________
|             base path             |            resource           |
https://www.linkedin.com/voyager/api /identity/profileView/tom-quirk

They are authenticated with a simple cookie, which we send with every request, along with a bunch of headers.

To get a cookie, we POST a given username and password (of a valid Linkedin user account) to https://www.linkedin.com/uas/authenticate.

Find new endpoints

We're looking at the Linkedin website and we spot some data we want. What now?

The following describes the most reliable method to find relevant endpoints:

  1. view source

  2. command-f/search the page for some keyword in the data. This will exist inside of a <code> tag.

  3. Scroll down to the next adjacent element which will be another <code> tag, probably with an id that looks something like

    <code style="display: none" id="datalet-bpr-guid-3900675">
      {"request":"/voyager/api/identity/profiles/tom-quirk/profileView","status":200,"body":"bpr-guid-3900675"}
    </code>

The value of request is the url! 🤘

You can also use the network tab in you browsers developer tools, but you will encounter mixed results.

How Clients query Voyager

linkedin.com uses the Rest-li 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.

Here's an example of making a request for an organisation's name and groups (the Linkedin groups it manages):

/voyager/api/organization/companies?decoration=(name,groups*~(entityUrn,largeLogo,groupName,memberCount,websiteUrl,url))&q=universalName&universalName=linkedin

The "querying" happens in the decoration parameter, which looks like the following:

(
    name,
    groups*~(entityUrn,largeLogo,groupName,memberCount,websiteUrl,url)
)

Here, we request an organisation name and a list of groups, where for each group we want largeLogo, groupName, and so on.

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.

In contrast, the /search/cluster endpoint uses q=guided, and specifies its query with the guided parameter, whose value is something like

List(v->PEOPLE)

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).

Release a new version

  1. Bump __version__ in __init__.py
  2. pipenv run build
  3. pipenv run publish

linkedin-api's People

Contributors

abinpaul1 avatar alexander-bakogeorge avatar alvaroserrrano avatar arkiralor avatar dependabot[bot] avatar dreamflasher avatar ebauger avatar edoarad avatar fliot avatar fornarat avatar hamizi-ikram avatar ignaciovi avatar jacob5412 avatar kais-viz avatar keducoop avatar kvyatkovskyaleksey avatar lmondada avatar mario-gazzara avatar mycaule avatar njoselson avatar pedrovhb avatar pww217 avatar redrrx avatar resident234 avatar robertoarruda avatar rvan-duy avatar samthesteersman avatar ssichynskyi avatar tbressers avatar tomquirk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

linkedin-api's Issues

search_people does not work properly

I found the bug referenced here.

Change L82, adding safe="()," to exclude problematic characters:

res = self._fetch(
    "/search/blended?{}".format(urlencode(default_params, safe="(),")),
    headers={"accept": "application/vnd.linkedin.normalized+json+2.1"},
)

Great work on this library! :)

Get all the conversation content?

Hi,

This is a great work! One question I have is how to get the full conversation content?

From the code I see how to send the messages, like below; and I guess getting the content for the conversation should be very similar. However, how do you compose the request and payload to get the content? (And how did you get all those format?)

Thanks!

    def send_message(self, conversation_urn_id, message_body):
        """
        Send a message to a given conversation. If error, return true.
        """
        params = {"action": "create"}

        payload = json.dumps(
            {
                "eventCreate": {
                    "value": {
                        "com.linkedin.voyager.messaging.create.MessageCreate": {
                            "body": message_body,
                            "attachments": [],
                            "attributedBody": {"text": message_body, "attributes": []},
                            "mediaAttachments": [],
                        }
                    }
                }
            }
        )

        res = self.client.session.post(
            f"{self.client.API_BASE_URL}/messaging/conversations/{conversation_urn_id}/events",
            params=params,
            data=payload,
        )

        return res.status_code != 201

Add ability to "view" a profile

View someones profile, such that they get a notification that you "viewed their profile" 👀 .

Request

fetch("https://www.linkedin.com/li/track", {
  headers: {
    accept: "*/*",
    "accept-language": "en-AU,en-GB;q=0.9,en-US;q=0.8,en;q=0.7",
    "cache-control": "no-cache",
    "content-type": "text/plain;charset=UTF-8",
    pragma: "no-cache",
    "sec-fetch-dest": "empty",
    "sec-fetch-mode": "no-cors",
    "sec-fetch-site": "same-origin",
    cookie: "redacted",
  },
  referrer: "https://www.linkedin.com/in/tom-quirk/",
  referrerPolicy: "no-referrer-when-downgrade",
  body: JSON.stringify(body),
  method: "POST",
  mode: "cors",
})

Where body is:

const body = {
    eventBody: {
      viewerPrivacySetting: "F",
      networkDistance: 2,
      vieweeMemberUrn: "urn:li:member:111111111", // target profile member URN
      // miniprofile Tracking Id
      profileTrackingId: "redacted",
      entityView: {
        viewType: "profile-view",
        viewerId: 222222222, // my member URN id (int)
        targetId: 111111111, // target profile member URN id (int)
      },
      header: {
        pageInstance: {
          pageUrn: "urn:li:page:d_flagship3_profile_view_base",
          // meta [name=clientPageInstanceId]
          trackingId: "redacted",
        },
        time: Date.now(),
        version: "1.6.8780",
        clientApplicationInstance: {
          applicationUrn: "urn:li:application:(voyager-web,voyager-web)",
          version: "1.6.8780",
          // meta[name=applicationInstance].content.trackingId
          trackingId: [
            // redacted
          ],
        },
      },
      requestHeader: {
        interfaceLocale: "en_US",
        pageKey: "d_flagship3_profile_view_base",
        path: "/in/tom-quirk/",
        referer: "https://www.linkedin.com/feed/",
      },
    },
    eventInfo: {
      appId: "com.linkedin.flagship3.d_web",
      eventName: "ProfileViewEvent",
      topicName: "ProfileViewEvent",
    },
  }

So, we need to get three pieces of data from the source HTML of the given profile for the body of our request:

  • clientApplicationInstance.trackingId: get this from the meta tag of selector meta[name=applicationInstance]
  • pageInstance.trackingId: from selector meta[name=clientPageInstanceId]
  • profileTrackingId: from the miniprofile

Installation and other issues

Hello,
I am using Pycharm and attempting to install your package.
First of all "pip install linkedin-api" raise an error, "no such file or directory README.md".

Anyway I have installed components as per travi.yml.

I run tests pipenv run python -m pytest tests -s and got 5 tests failed, the main of them is "ERROR at setup of test_get_profile_connections", it seems I cannot get authenticated. Login/psw are absolutely right and I am connecting by the same IP I normally use for logging linkedin.

I modified .env.example to .env and this is its content
LINKEDIN_USERNAME="[email protected]"
LINKEDIN_PASSWORD="**************"
TEST_PROFILE_ID="ACoAABQ11fIBQLGQbB1V1XPBZJsRwfK5r1U2Rzt"
TEST_CONVERSATION_ID="6419123050114375168"

------>>> Pycharm raise an "unresolved reference" for linkedin.api.* <<<-----

Could someone kindly help me?

Support ability to send Linkedin messages

  1. GET the conversation first to get the conversationId
voyager/api/messaging/conversations? 
keyVersion=LEGACY_INBOX&q=participants&recipients=List(<urn_id>)
  1. POST to prove I'm typing
voyager/api/messaging/conversations?action=typing
data = {
  "conversationId":"1234506060"
}
  1. POST to send the message
    url:
/voyager/api/messaging/conversations/<conversationId>/events?action=create
{"eventCreate":{"value":{"com.linkedin.voyager.messaging.create.MessageCreate":{"body":"test","attachments":[],"attributedBody":{"text":"test","attributes":[]},"mediaAttachments":[]}}}}

Industry ids, company ids

Hello!

Company search and people search both accept industry, company ids, etc.

How to get those IDS?

Issue in reading/saving cookies - Ubuntu 14

Hello,

there is an issue about saving/reading cookies in Ubuntu 14: cookies are not being saved totally and this causes a 401 error when API are used.

In windows it works fine but in Ubuntu I think pickle load/save has some char or encoding difference.

search_people with regions fails

I run the code listed in the examples (and other attempts)

results = linkedin.search_people(
keywords='software,lol',
connection_of='AC000120303',
network_depth='F',
regions=[4909],
industries=[29, 1]
)

but I got this error


in search_people
filters.append(f'geoRegion->{"|".join(regions)}')
TypeError: sequence item 0: expected str instance, int found


Getting ChallengeException(data["login_result"]) when running through Azure Functions

Locally client.py works but while running the same code through Azure function it gives below error -
Result: Failure
Exception: ChallengeException: CHALLENGE
Stack: File "/usr/local/lib/python3.6/site-packages/azure/functions_worker/dispatcher.py", line 300, in _handle__invocation_request
self.__run_sync_func, invocation_id, fi.func, args)
File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.6/site-packages/azure/functions_worker/dispatcher.py", line 389, in __run_sync_func
return func(**params)
File "/home/site/wwwroot/connections/init.py", line 11, in main
return getConnections(req)
File "/home/site/wwwroot/connections/init.py", line 16, in getConnections
api = Linkedin(content['email'],content['password'])
File "/home/site/wwwroot/.python_packages/lib/python3.6/site-packages/linkedin_api/linkedin.py", line 37, in init
self.client.authenticate(username, password)
File "/home/site/wwwroot/.python_packages/lib/python3.6/site-packages/linkedin_api/client.py", line 116, in authenticate
raise ChallengeException(data["login_result"])

Search people function stopped working

I started getting this error:

File "C:\Users\Andrew\Documents\venv\lib\site-packages\linkedin_api\linkedin.py", line 158, in search_people
    data = self.search(params, limit=limit)
  File "C:\Users\Andrew\Documents\venv\lib\site-packages\linkedin_api\linkedin.py", line 91, in search
    for i in range(len(data["data"]["elements"])):
KeyError: 'data'

I added these checks before the loop in your library:

if data:
   if "data" in data:

It solved the error but search yields 0 results. Seems like LinkedIn stopped returning results by this endpoint.

During the past several days everything worked fine. I currently tried to authorize with different accounts and run code on several machines (Windows and Linux) with different IPs but the issue still persists

Parameter-less search returns no results found

When I try to execute a search with default params, the search itself will run to completion, but then on the last call it will print 'found none..." and return an empty list.

DEBUG:urllib3.connectionpool:https://www.linkedin.com:443 "GET /voyager/api/search/cluster?count=49&guides=List%28v-%3EPEOPLE%29&origin=GLOBAL_SEARCH_HEADER&q=guided&start=882 HTTP/1.1" 200 None
DEBUG:linkedin_api.linkedin:results grew: 931
DEBUG:urllib3.connectionpool:https://www.linkedin.com:443 "GET /voyager/api/search/cluster?count=49&guides=List%28v-%3EPEOPLE%29&origin=GLOBAL_SEARCH_HEADER&q=guided&start=931 HTTP/1.1" 200 None
DEBUG:linkedin_api.linkedin:results grew: 980
DEBUG:urllib3.connectionpool:https://www.linkedin.com:443 "GET /voyager/api/search/cluster?count=49&guides=List%28v-%3EPEOPLE%29&origin=GLOBAL_SEARCH_HEADER&q=guided&start=980 HTTP/1.1" 200 None
DEBUG:linkedin_api.linkedin:results grew: 1000
DEBUG:urllib3.connectionpool:https://www.linkedin.com:443 "GET /voyager/api/search/cluster?count=49&guides=List%28v-%3EPEOPLE%29&origin=GLOBAL_SEARCH_HEADER&q=guided&start=1000 HTTP/1.1" 200 None
DEBUG:linkedin_api.linkedin:found none...

It appears it's an issue with the last search result having no paging and hitting the if statement in this block of code in the search function in linkedin.py

total_found = data.get("paging", {}).get("total")
if total_found == 0 or total_found is None:
    self.logger.debug("found none...")
    return []

A possible solution would be to require results to be empty as well before hitting the if

total_found = data.get("paging", {}).get("total")
if results == [] and (total_found == 0 or total_found is None):
     self.logger.debug("found none...")
     return []

Searching for people currently at a particular company yields no correct results

Using the search_people(current_company=['1441']) function is meant to list all employees at company 1441 (Google), however it yields no correct results. It generates a long list of people that do not work at the company in question, looks similar to a 'people you may know' list.

The script generates the following URL:

/voyager/api/search/blended?count=49&filters=List(resultType->PEOPLE,currentCompany->1441)&origin=GLOBAL_SEARCH_HEADER&q=all&start=0&queryContext=List(spellCorrectionEnabled->true,relatedSearchesEnabled->true,kcardTypes->PROFILE|COMPANY)

When I attempt the same search on desktop it generates the following url in the source code:

/voyager/api/search/blended?count=10&filters=List(currentCompany->1441|791962|2374003|18950635|16140|10440912,resultType->PEOPLE)&origin=OTHER&q=all&queryContext=List(spellCorrectionEnabled->true,relatedSearchesEnabled->true,kcardTypes->PROFILE|COMPANY|JOB_TITLE)&start=0

I notice the differences with respect to 'origin' and count. Changing the code so that these match does not seem to help.

Support ability to send Linkedin connection requests

I.e. Add people on Linkedin

POST

{"trackingId":"XVpxyROJQ1ybTCQtEFrl8A==","invitations":[],"excludeInvitations":[],"invitee":{"com.linkedin.voyager.growth.invitation.InviteeProfile":{"profileId":"<profile_id>"}}}

to url

/voyager/api/growth/normInvitations

Decoration ID issue

Hello,

I'm using your library and i couldn't get get_company to work, i dug into it and i figure that the decoration was wrong and lead to a 400 error. I got it working by remove it or use a decorationId like

"decorationId": "com.linkedin.voyager.deco.organization.web.WebFullCompanyMain-12"

I guess it will also be the case for get_school

Regards

Erwan

Improve authentication "anti-bot-detection" mechanism

Not sure if you've encountered this case, but the authentication sometimes doesn't work for me. The following exception will be thrown out:

res.status_code 401
Traceback (most recent call last):
  File "F:/linkedin-api/examples/basic.py", line 60, in <module>
    linkedin = Linkedin(credentials['username'], credentials['password'])
  File "F:\linkedin-api\linkedin_api\linkedin.py", line 30, in __init__
    self.client.authenticate(username, password)
  File "F:\linkedin-api\linkedin_api\client.py", line 102, in authenticate
    raise Exception()
Exception

I am thinking it might be the case that LinkedIn is blocking the API for some reason, but the account itself is fine (I can still login thru the web portal) - so I am wondering if you've encountered this before?

Can't get connections beyond 1000

I have a linkedin account which has 3000 first connections but get_profile_connections(urn_id=...) only gives me 1000 records? Can I get all the 3000 records?

Error when I use search function

Search function isnt working
search term: 'starshot software'

  File "basic.py", line 6, in <module>
    linkedin.search('starshot software');
  File "/usr/local/lib/python3.6/site-packages/linkedin_api/linkedin.py", line 42, in search
    default_params.update(params)
ValueError: dictionary update sequence element #0 has length 1; 2 is required```

Get engagers (likers/commenters) of a post

I've been going through the code, and I don't think so, but just in case.

The idea would be to have two functions, one function to extract the shares of a particular user: https://www.linkedin.com/in/tom-quirk/detail/recent-activity/shares/

And output the LinkedIn share posts: https://www.linkedin.com/posts/tom-quirk_how-we-used-ai-to-translate-sign-language-activity-6449782512817446912-9X3U/

And another function that allows extracting the likers of the shares and outputs the id of the likers

Could this be the endpoint of the likers?

https://www.linkedin.com/voyager/api/feed/reactions?count=10&q=reactionType&start=10&threadUrn=urn%3Ali%3Aactivity%3A6590338540985470976

CSRF check failed

Hello,

I have logged to Linkedin but Voyger API raise a CSRF error, for this reason (I think) I am not able to extract data.
Consider that I have just installed the package so I have not run big scraping.

GET company

Overview

GET a company from Linkedin

Acceptance

  • method, i.e. get_company, that takes a [public_identifier] or [linkedin URN ID], that returns a company object

Authentication doesn't work

Hello
I'm trying to execute basic authentication code:

from linkedin_api import Linkedin
api = Linkedin('myEmailHere', 'myPasswordHere')

I got an error:

Traceback (most recent call last):
  File "C:\Users\Andrew\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 588, in urlopen
    conn = self._get_conn(timeout=pool_timeout)
  File "C:\Users\Andrew\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 248, in _get_conn
    return conn or self._new_conn()
  File "C:\Users\Andrew\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 816, in _new_conn
    raise SSLError("Can't connect to HTTPS URL because the SSL "
urllib3.exceptions.SSLError: Can't connect to HTTPS URL because the SSL module is not available.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Andrew\Anaconda3\lib\site-packages\requests\adapters.py", line 449, in send
    timeout=timeout
  File "C:\Users\Andrew\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 638, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "C:\Users\Andrew\Anaconda3\lib\site-packages\urllib3\util\retry.py", line 398, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.linkedin.com', port=443): Max retries exceeded with url: /uas/authenticate (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available."))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:/Users/Andrew/PycharmProjects/Crawlers/app/li/linkedin_com.py", line 24, in <module>
    main()
  File "C:/Users/Andrew/PycharmProjects/Crawlers/app/li/linkedin_com.py", line 20, in main
    api = Linkedin('*******', '*******')
  File "C:\Users\Andrew\Anaconda3\lib\site-packages\linkedin_api\linkedin.py", line 37, in __init__
    self.client.authenticate(username, password)
  File "C:\Users\Andrew\Anaconda3\lib\site-packages\linkedin_api\client.py", line 98, in authenticate
    self._set_session_cookies(self._request_session_cookies())
  File "C:\Users\Andrew\Anaconda3\lib\site-packages\linkedin_api\client.py", line 76, in _request_session_cookies
    headers=Client.AUTH_REQUEST_HEADERS,
  File "C:\Users\Andrew\Anaconda3\lib\site-packages\requests\api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "C:\Users\Andrew\Anaconda3\lib\site-packages\requests\api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "C:\Users\Andrew\Anaconda3\lib\site-packages\requests\sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "C:\Users\Andrew\Anaconda3\lib\site-packages\requests\sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "C:\Users\Andrew\Anaconda3\lib\site-packages\requests\adapters.py", line 514, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='www.linkedin.com', port=443): Max retries exceeded with url: /uas/authenticate (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available."))

I only hid username and password in the error output

SyntaxError: invalid syntax

after install linkedin-api,when import linkedin_api,SyntaxError: invalid syntax

import linkedin_api
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python3.4/site-packages/linkedin_api/init.py", line 4, in
from .linkedin import Linkedin
File "/usr/lib/python3.4/site-packages/linkedin_api/linkedin.py", line 48
url = f"{self.client.API_BASE_URL}{uri}"
^

Is there a limit for api.get_profile_connections?

Thanks for the API and it is very helpful.

It seems that there is 1000 rate limit for how many profile it can pull for Distance_1 and Distance_2. Is there a way to bypass this pull limit? Thanks in advance.

Adding people to groups

Hello,
this is not an issue but a new feature I'am trying to develop. The idea is to adding people to a given group, this is the code

def invita_gruppi(self, group_id, urn_id):
params = {"action": "create"}
eu = "urn:li:fs_groupMembership:(" + str(group_id) + "," + str(urn_id) + ")"
payload = json.dumps(
{
"elements" :[{
"entityUrn": eu,
"groupUrn": "urn:li:fs_group:" + str(group_id) ,
"miniProfileUrn": "urn:li:fs_miniProfile:" + str(urn_id),
"status": "INVITE_PENDING"
}]
}
)
print(payload)
res = self._post(
f"/groups/groupMemberships",
#params=params,
data=payload,
)
return res.status_code == 201

I have tryed in all way I could imagine but I did not succed. If somebody could help this could be a new feature to be added to the project

Page

How can I specify a page in default_params ?

GET school

Overview

GET a school from Linkedin

Acceptance

  • method, i.e. get_school, that takes a [public_identifier] or [linkedin URN ID], that returns a company object

Get Profile not working

Suddenly the get_people function stopped working, no challenge on the profile and no problem on accessing the account on the browser.

No error is returned.

Maybe a new endpoint?

CI/CD and PyPI

First of all, thanks for this great project! 👍
already built a cool little linkedin bot with it 👨‍💻

One thing made me a bit sad it that the docs not in align with the latest PyPI package.
(linkedin.get_invitations and linkedin.reply_invitation are missing).

That's when I realized that most of the recent changes can only be used if you install the package from source, which ofc not a big problem just a little uncomfy.

Can we set up a CI/CD pipeline which auto deploy to PyPI?

Send message to connected people

Hello,

for what I see it is possible to send messages only to people with wich a conversation has started already.
I wonder if and how it would be possible to send a message to connected people even if no conversation has started.

Thank you!

send_message to recipients does not work

Hello,

I was testing sending messages and it works Correct if I run this code:
api.send_message(conversation_urn_id='6551874681396359168', message_body="Hello from PYTHON")
but does not work with:
api.send_message(recipients=['ping-pong-168639158'], message_body="Hello from PYTHON")

Seems like case with recipients does not work correct. It returns {"status":422}

Can you pls help me?
Thanks.

Init travis

To run linting and tests (when we have them)

Linkedin function not working

Hi tomquirk,

Thank you for your great package!
However, as a newbie, I met several problems since the install step.

  • It seems -e should be removed from the Installation step.

  • And after I load the package, I can't even use the first step by Linkedin function. For example, this is not working api = Linkedin('[email protected]', 'iheartmicrosoft'). And the error is 'CookieRepository' object has no attribute 'logger'.

I would be appreciated if you could tell me how to solve this problem. And my system is Windows 10 pro, Python 3.7.3 with Anaconda.
Thanks for your reply!

Sheng

Search filters not working for search_people

When running search_people, parameters don't seem to be working. Instead, I get the same list that's returned when you search for your first degree connections.

I verified that the parameters were correct by replicating the search in browser and looking at the parameters with the calls made.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.