Skip to content

Instantly share code, notes, and snippets.

@nathanhere
Created May 9, 2013 08:29
Show Gist options
  • Save nathanhere/5546280 to your computer and use it in GitHub Desktop.
Save nathanhere/5546280 to your computer and use it in GitHub Desktop.
Some examples of using the python-linkedin API calls. Must pass OAuth in order to use.
# Actual Search URL takes the form of https://api.linkedin.com/v1/people-search:(people:(first-name,last-name))?keywords=apple%20microsoft
results = application.search_profile(selectors=[{'people': ['first-name', 'last-name', 'headline', 'id', 'location', 'public-profile-url']}], params={'keywords': 'apple microsoft'})
profiles = [p for p in results['people']['values']] # returns the list of profiles only
# Set connection search limit. Start is the starting profile number, count is the number of profiles returned from the start number. In this case, it is 100.
application.get_connections(selectors=['headline', 'id','first-name', 'last-name','location'], params={'start':0, 'count':100})
profiles = [p for p in results['people']['values']] # returns the list of profiles only
# As of late 2012, this only retrieves the app user's own full profile info, and will not fetch full profile features (i.e. SKILLS) of connections, only basic profile info. Calling this function without a member_id parameter will pull the app user's own profile, as shown below
application.get_profile(selectors=['id', 'first-name', 'last-name', 'location', 'headline','distance', 'num-connections', 'skills', 'educations','public-profile-url'])
# Example of making an API call for a specific user based on member_id parameter. Other fields available can be accessed at http://developers.linkedin.com/documents/profile-fields
application.get_profile(member_id='DF8LKjDOnK',selectors=['skills','public-profile-url'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment