LinkedIn
Improve your KYC thanks to Linkedin connection
LinkedIn: Log In or Sign Up
LinkedIn
As of June 2021, we are starting a refactoring of the LinkedIn driver, please refer to the awesome-notebook Github page to get the latest updates.

Get your cookies

To access your LinkedIn data, you need to learn how to get your cookies.
To get your cookies, please follow this tutorial.

Get

Profile

Formula

1
from naas_drivers import linkedin
2
3
# Enter cookies information
4
LI_AT = 'YOUR_COOKIE_LI_AT' # EXAMPLE : AQFAzQN_PLPR4wAAAXc-FCKmgiMit5FLdY1af3-2
5
JSESSIONID = 'YOUR_COOKIE_JSESSIONID' # EXAMPLE : ajax:8379907400220387585
6
7
# Enter the linkedin id or linkedin url
8
url = "LINKEDIN_ID" or "LINKEDIN_URL"
9
10
# Get dataframe as result
11
df = linkedin.connect(LI_AT, JSESSIONID).get_profil(url)
12
df
Copied!

Result

  • FIRSTNAME : First name
  • LASTNAME : Last name
  • BIRTHDATE_DAY : Day of birth in format DD
  • BIRTHDATE_MONTH : Month of birth in format MM
  • BIRTHDATE_YEAR : Year of birth in format YYYY
  • BIRTHDATE : Birthdate in format DD, MM - YYYY
  • COUNTRY : Country name
  • ADDRESS : Address
  • LK_HEADLINE : Job description (headline)
  • LK_SECTOR : Work industry
  • LK_FOLLOWERS : Number of followers
  • LK_PHONE : Phone number
  • LK_EMAIL : Email
  • LK_TWITER : Twitter account

Messages (last 20)

Formula

1
from naas_drivers import linkedin
2
3
# Enter cookies information
4
LI_AT = "YOUR_COOKIE_LI_AT" # EXAMPLE AQFAzQN_PLPR4wAAAXc-FCKmgiMit5FLdY1af3-2
5
JSESSIONID = "YOUR_COOKIE_JSESSIONID" # EXAMPLE ajax:8379907400220387585
6
7
# Get dataframe as result
8
df = linkedin.connect(LI_AT, JSESSIONID).get_messages()
9
df
Copied!

Result

  • FIRSTNAME : First name
  • LASTNAME : Last name
  • OCCUPATION : Job description (headline)
  • PROFILE_PUBLIC_ID : LinkedIn ID
  • LAST_ACTIVITY : Last activity in format YYYY-MM-DD HH:MM:SS
  • LAST_READ_AT : Last message read at in format YYYY-MM-DD HH:MM:SS
  • MESSAGE_TEXT : Message content
  • MESSAGE_TYPE : Message type

Post data

Formula

1
from naas_drivers import linkedin
2
3
# Enter cookies information
4
LI_AT = "YOUR_COOKIE_LI_AT" # EXAMPLE AQFAzQN_PLPR4wAAAXc-FCKmgiMit5FLdY1af3-2
5
JSESSIONID = "YOUR_COOKIE_JSESSIONID" # EXAMPLE ajax:8379907400220387585
6
7
# Enter post url
8
url = "YOUR_POST_URL"
9
10
# Get dataframe as result
11
df = linkedin.connect(LI_AT, JSESSIONID).get_post_data(url)
12
df
Copied!

Result

  • URL : Post url
  • TITLE : Post text before first break
  • DATE : Time since post publication
  • VIEWS : Numbers of views
  • COMMENTS : Numbers of comments
  • LIKES : Numbers of likes
  • LIKES_LIKE : Numbers of likes type "like"
  • LIKES_PRAISE : Numbers of likes type "praise"
  • LIKES_INTEREST : Numbers of likes type "interest"
  • LIKES_APPRECIATION : Numbers of likes type "appreciation"
  • LIKES_EMPATHY : Numbers of likes type "empathy"

Advanced

You can "connect" before any other methods and use your object in your formulas
1
from naas_drivers import linkedin
2
3
# Enter cookies information
4
LI_AT = "YOUR_COOKIE_LI_AT" # EXAMPLE AQFAzQN_PLPR4wAAAXc-FCKmgiMit5FLdY1af3-2
5
JSESSIONID = "YOUR_COOKIE_JSESSIONID" # EXAMPLE ajax:8379907400220387585
6
7
# Connect to Linkedin
8
LK = linkedin.connect(LI_AT, JSESSIONID)
9
10
# Get last 20 messages
11
df = LK.get_messages()
Copied!