{"id":4610,"library":"linkedin-api-client","title":"LinkedIn API Python Client","description":"The official Python client library for LinkedIn APIs. It provides a thin client for making requests to LinkedIn APIs, handling the complexities of the Rest.li framework, formatting requests, and managing authentication (OAuth2). The library aims to reduce the difficulty of interacting with LinkedIn's robust but complex API protocol. The current version is 0.3.0, and it maintains an active release cadence.","status":"active","version":"0.3.0","language":"en","source_language":"en","source_url":"https://github.com/linkedin-developers/linkedin-api-python-client","tags":["linkedin","api","client","oauth","restli"],"install":[{"cmd":"pip install linkedin-api-client","lang":"bash","label":"Install stable version"}],"dependencies":[],"imports":[{"symbol":"RestliClient","correct":"from linkedin_api.clients.restli.client import RestliClient"},{"symbol":"AuthClient","correct":"from linkedin_api.clients.auth.auth_client import AuthClient"},{"note":"The `Linkedin` class from `linkedin_api` (lowercase) refers to a popular, unofficial library that is *not* this official client. Using the unofficial library may violate LinkedIn's Terms of Service.","wrong":"from linkedin_api import Linkedin","symbol":"Linkedin","correct":"from linkedin_api.clients.restli.client import RestliClient"}],"quickstart":{"code":"import os\nfrom linkedin_api.clients.restli.client import RestliClient\n\n# Get your 3-legged access token from environment variables or a secure store.\n# This token must be generated via the LinkedIn Developer Portal's OAuth 2.0 flow.\nACCESS_TOKEN = os.environ.get('LINKEDIN_ACCESS_TOKEN', 'YOUR_ACCESS_TOKEN_HERE')\n\nif not ACCESS_TOKEN or ACCESS_TOKEN == 'YOUR_ACCESS_TOKEN_HERE':\n    raise ValueError(\"Please set the LINKEDIN_ACCESS_TOKEN environment variable or replace the placeholder.\")\n\nrestli_client = RestliClient()\n\ntry:\n    # Example: Fetch current user's information\n    response = restli_client.get(\n        resource_path=\"/userinfo\",\n        access_token=ACCESS_TOKEN\n    )\n    print(\"Successfully fetched user info:\")\n    print(response.entity)\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")","lang":"python","description":"This quickstart demonstrates how to make a simple GET request to the `/userinfo` endpoint using the `RestliClient`. It requires a 3-legged access token with appropriate scopes (e.g., `openid`, `profile`) obtained from the LinkedIn Developer Portal. Ensure you replace `YOUR_ACCESS_TOKEN_HERE` with a valid token or set the `LINKEDIN_ACCESS_TOKEN` environment variable."},"warnings":[{"fix":"Monitor official GitHub releases and documentation for updates and stability improvements. Implement robust error handling and fallback mechanisms in production applications.","message":"This API client library is officially in beta and is subject to change. It may contain bugs, errors, or other issues. Use in production environments should be approached with caution, and users should be prepared for unexpected behavior.","severity":"beta","affected_versions":"0.1.0 - 0.3.0"},{"fix":"Always verify the import path (`from linkedin_api.clients.restli.client import RestliClient`) to ensure you are using the official client. Consult the official GitHub repository for this library.","message":"There are multiple Python libraries for LinkedIn, including a popular unofficial one (`linkedin-api` by Tom Quirk) that uses web scraping/simulation. This official `linkedin-api-client` library requires proper OAuth2 authentication and interaction via the LinkedIn Developer Portal, while the unofficial one may work by using a username/password, potentially violating LinkedIn's Terms of Service.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Regularly consult the LinkedIn Developer documentation for API versioning and breaking changes. Test your integration thoroughly when new API versions are released or when updating the client library. Specify API versions in your requests where possible if the client supports it.","message":"LinkedIn's underlying APIs are frequently updated with monthly versions, and these can introduce breaking changes (e.g., changes to resource paths, required fields, or deprecation of features). The client library aims to abstract some of this, but direct API calls may still be affected.","severity":"breaking","affected_versions":"All versions (due to upstream API changes)"},{"fix":"Familiarize yourself with the LinkedIn OAuth2 documentation. Ensure your LinkedIn application is correctly configured with necessary scopes and redirect URIs. For 3-legged auth, users must authorize your application in a web browser to get an authorization code, which is then exchanged for an access token.","message":"Authentication for the official LinkedIn API client relies on OAuth2 flows (2-legged for applications, 3-legged for user-specific actions). Obtaining valid access tokens (especially 3-legged) requires a pre-requisite setup in the LinkedIn Developer Portal, including creating an application, requesting API product access, and configuring redirect URIs.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Check the GitHub Issues for `linkedin-api-python-client` for specific workarounds or fixes related to pagination. Implement custom pagination logic if the built-in methods are not functioning as expected for your target API endpoints.","message":"Some GitHub issues indicate that pagination may be broken with certain API versions, particularly for cursor-based pagination.","severity":"gotcha","affected_versions":"Potentially 0.1.0 - 0.3.0 (depending on API version used)"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}