The Python Linkedin provides a easy interface to the Linkedin API.
We are in development, if you want to help, please see CONTRIBUTING
You can to install through pip.
pip install PyLinkedinAPI
If you don't have a access token I recommend to use the requests-oauthlib
See examples here
You need to generate temporary access token for basic tests:
- Acces the https://developer.linkedin.com/rest-console
- On then Authentication menu select OAuth2
- After you need to login and authorization to access some information from your LinkedIn profile
- Send anywhere request URL, for example https://api.linkedin.com/v1/people/~?format=json, and copy field access token
Run python examples/basic.py
and insert the access token
from PyLinkedinAPI.PyLinkedinAPI import PyLinkedinAPI
access_token = 'AQVaE34Qblm6uIhh3wVLXuhQPSI...'
linkedin = PyLinkedinAPI(access_token)
Get data profile
profile = linkedin.get_basic_profile()
print(profile)
Get data companies
companies = linkedin.get_companies()
print(companies)
Publish comment on profile
linkedin.publish_profile_comment('This is my first package in Python')
Publish comment on company
linkedin.publish_company_comment(5470551, 'This is my first package in Python')
Publush Content/Comment on profile
linkedin.publish_profile(comment,
title=title, description=description,
submitted_url='http://www.johnidouglas.com.br/',
submitted_image_url='http://www.johnidouglas.com.br/logo.jpeg')
Publush Content/Comment on company
linkedin.publish_company(5470551,
comment,
title=title, description=description,
submitted_url='http://www.johnidouglas.com.br/',
submitted_image_url='http://www.johnidouglas.com.br/logo.jpeg)
-
REST Console