Where it all begins. Create an instance of Linkedin
to get started. You'll automatically get authenticated.
Arguments
username <str>
- Linkedin usernamepassword <str>
- Linkedin passwordrefresh_cookies <boolean>: kwarg
- Whether to refresh any cached cookiesdebug <boolean>: kwarg
- Enable debug loggingproxies <dict>: kwarg
- Proxies to use, of Python Requests format
Returns a Linkedin profile.
Arguments One of:
public_id <str>
- public identifier i.e. tom-quirk-1928345urn_id <str>
- id provided by the Linkedin URN
Return
<dict>
- that includes languages, publications, certifications, volunteer, honors
Example
linkedin = Linkedin(credentials['username'], credentials['password'])
profile = linkedin.get_profile('tom-quirk')
Returns a Linkedin profile's first degree (direct) connections
Arguments
urn_id <str>
- id provided by the Linkedin URN
Return
<list>
Example
linkedin = Linkedin(credentials['username'], credentials['password'])
connections = linkedin.get_profile_connections('AC000102305')
Returns a Linkedin profile's contact information.
Arguments One of:
public_id <str>
- public identifier i.e. tom-quirk-1928345urn_id <str>
- id provided by the Linkedin URN
Return
<dict>
Example
linkedin = Linkedin(credentials['username'], credentials['password'])
profile_info = linkedin.get_profile_contact_info('tom-quirk')
Returns a Linkedin profile's skills.
Arguments One of:
public_id <str>
- public identifier i.e. tom-quirk-1928345urn_id <str>
- id provided by the Linkedin URN
Return
<dict>
Example
linkedin = Linkedin(credentials['username'], credentials['password'])
profile_info = linkedin.get_profile_skills('AC000102305')
Removes a connection on Linkedin
Arguments
public_id <str>
- public identifier i.e. tom-quirk-1928345
Return
<bool>
- True if err
Example
linkedin = Linkedin(credentials['username'], credentials['password'])
err = linkedin.remove_connection('tom-tom-quirk-1928345')
Returns a school's Linkedin profile.
Arguments
public_id <str>
- public identifier i.e. university-of-queensland
Return
<dict>
Example
linkedin = Linkedin(credentials['username'], credentials['password'])
school = linkedin.get_school('university-of-queensland')
Returns a company's Linkedin profile.
Arguments
public_id <str>
- public identifier i.e. linkedin
Return
<dict>
Example
linkedin = Linkedin(credentials['username'], credentials['password'])
company = linkedin.get_company('linkedin')
Returns job posting details. The job_urn_id can be found in the "jobPosting" fields in the response of a linkedin.search
for job postings, (i.e, with query param decoration_id=com.linkedin.voyager.deco.jobs.web.shared.WebFullJobPosting-39).
Arguments
job_urn_id <str>
- job id, e.g: '1792209257'
Return
<dict>
Example
linkedin = Linkedin(credentials['username'], credentials['password'])
job_posting = linkedin.get_job_posting('1754968923")
Perform a Linkedin search and return the results. A reference of country and industry codes can be found here.
Arguments
params <dict>
- search parameters (see implementation of search_people for a reference)- `max_results - the max number of results to return
Return
<list>
Example
linkedin = Linkedin(credentials['username'], credentials['password'])
results = linkedin.search({'keywords': 'software'}, 200)
Return a list of metadata of the user's conversations.
Return
<list>
Example
linkedin = Linkedin(credentials['username'], credentials['password'])
conversations = linkedin.get_conversations()
Return a conversation
Arguments
conversation_urn_id <str>
- ID of the conversation
Return
<dict>
Example
linkedin = Linkedin(credentials['username'], credentials['password'])
conversation = linkedin.get_conversation('6446595445958545408')
Return the conversation details (metadata) for a given profile_urn_id.
Use this endpoint to get the conversation id
to send messages (see example).
Arguments
profile_urn_id <str>
- the urn id of the profile
Return
<dict>
Example
linkedin = Linkedin(credentials['username'], credentials['password'])
profile = linkedin.get_profile('bill-g')
profile_urn_id = profile['profile_id']
conversation_details = linkedin.get_conversation_details(profile_urn_id)
# example: getting the conversation_id
conversation_id = conversation_details['id']
Sends a message to the given [conversation_urn_id] OR list of recipients
Arguments
conversation_urn_id <str>
- the urn id of the conversationrecipients <list(str)>
- a list of profile urn id'smessage_body <str>
- the message to send
Return
<boolean>
- True if error
Example
linkedin = Linkedin(credentials['username'], credentials['password'])
profile = linkedin.get_profile('bill-g')
profile_urn_id = profile['profile_id']
conversation = linkedin.get_conversation_details(profile_urn_id)
conversation_id = conversation['id']
err = linkedin.send_message(conversation_urn_id=conversation_id, message_body="No I will not be your technical cofounder")
if err:
# handle error
return
Mark a given conversation as seen.
Arguments
conversation_urn_id <str>
- the urn id of the conversation
Return
<boolean>
- True if error
Example
linkedin = Linkedin(credentials['username'], credentials['password'])
profile = linkedin.get_profile('bill-g')
profile_urn_id = profile['profile_id']
conversation = linkedin.get_conversation_details(profile_urn_id)
conversation_id = conversation['id']
err = linkedin.mark_conversation_as_seen(conversation_id)
if err:
# handle error
return
Get view statistics for the current profile. Includes views over time (chart data)
Example
linkedin = Linkedin(credentials['username'], credentials['password'])
views = linkedin.get_current_profile_views()
linkedin.search_people(keywords=None, connection_of=None, network_depth=None, regions=None, industries=None)
Perform a Linkedin search for people and return the results. A reference of country and industry codes can be found here.
Arguments
keywords <str>
- keywords, comma seperatedconnection_of <str>
- urn id of a profile. Only people connected to this profile are returnednetwork_depth <str>
- the network depth to search within. One of {F
,S
, orO
} (first, second and third+ respectively)regions <list>
- list of Linkedin region idsindustries <list>
- list of Linkedin industry ids- ... more (see code)
Return
<list>
Example
linkedin = Linkedin(credentials['username'], credentials['password'])
results = linkedin.search_people(
keywords='software,lol',
connection_of='AC000120303',
network_depth='F',
regions=['au:4909'],
industries=['29', '1']
)
linkedin.search_companies(keywords=None, connection_of=None, network_depth=None, regions=None, industries=None)
Perform a Linkedin search for companies and return the results.
Arguments
keywords <str>
- keywords, comma seperatedlimit <int>
- search limit
Return
<list>
Example
linkedin = Linkedin(credentials['username'], credentials['password'])
results = linkedin.search_companies(
keywords='linkedin'
)
Get all the invitations for the current authenticated profile.
Example
linkedin = Linkedin(credentials['username'], credentials['password'])
invitations = linkedin.get_invitations()
Reply to the given invite (invitation_entity_urn) with one of the possible actions action=["accept"|"ignore"]. The default is to accept the given invitation.
Example
linkedin = Linkedin(credentials['username'], credentials['password'])
invite_to_accept = linkedin.get_invitations()[0]
invite_to_ignore = linkedin.get_invitations()[1]
linkedin.reply_invitation(invitation_entity_urn=invite_to_accept['entityUrn'], invitation_shared_secret=invite_to_accept['sharedSecret'])
linkedin.reply_invitation(invitation_entity_urn=invite_to_ignore['entityUrn'], invitation_shared_secret=invite_to_ignore['sharedSecret'], action="ignore")
Send a profile view (i.e. "<your_name> viewed your profile")
Arguments
public_id <str>
- public identifier i.e. tom-quirk-1928345
Return
<boolean>
Example
linkedin = Linkedin(credentials['username'], credentials['password'])
profile = linkedin.view_profile('tom-quirk')
Get the privacy settings for a given profile. Useful to determine whether the profile is publicly accessible.
Arguments
public_id <str>
- public identifier i.e. tom-quirk-1928345
Return
<boolean>
Example
linkedin = Linkedin(credentials['username'], credentials['password'])
profile = linkedin.get_profile_privacy_settings('tom-quirk')
Get member badges for a given profile. As of writing this, badges may include:
influencer <boolean>
jobSeeker <boolean>
openLink <boolean>
premium <boolean>
Arguments
public_id <str>
- public identifier i.e. tom-quirk-1928345
Return
<boolean>
Example
linkedin = Linkedin(credentials['username'], credentials['password'])
profile = linkedin.get_profile_member_badges('tom-quirk')
Get high level information about a given profile's network. Useful for follower counts followability, distance from the authed user, etc.
Arguments
public_id <str>
- public identifier i.e. tom-quirk-1928345
Return
<boolean>
Example
linkedin = Linkedin(credentials['username'], credentials['password'])
profile = linkedin.get_profile_network_info('tom-quirk')