Simplify Your Development with New LinkedIn API Clients

From listening to your feedback, we’ve heard that it can be difficult to start building integrations with LinkedIn’s APIs. One of the main difficulties we’ve seen is working with our robust yet complex Rest.li framework and protocol that our APIs are built on.

Our Solution

The LinkedIn API Client Libraries are currently available in JavaScript and Python and can be easily dropped into your existing application code. The libraries include comprehensive documentation and examples (JavaScript client examples, Python client examples).

Note that these client libraries do not offer support for specific APIs - they provide an abstraction on top of the Rest.li protocol, making it easier to construct API requests to LinkedIn. This dramatically simplifies the process for you to build your own higher-level clients for specific APIs.

Some of the key features of the LinkedIn API Client Libraries include:

  • RestliClient with support for all Rest.li methods 
  • AuthClient with support for token creation/management
  • Typed interfaces to enable code completion and inline documentation in IDEs
  • Rest.li protocol 2.0 support
  • Automatic key/query parameter encoding
  • Support for versioned APIs
  • Automatic query tunneling of requests, if required

An Example To Consider

Consider searching for ad accounts using our Advertising API. For a NodeJS application using an HTTP client library like axios, there are quite a few details to get right to perform a working request, as shown in the following sample code: base URL, resource prefix, auth and custom headers, and correct encoding of complex query parameters. The result can be difficult to write and maintain, and doesn’t account for edge cases requiring query tunneling.

Example code illustrating use of a generic HTTP client for searching ad accounts
Example code illustrating use of a generic HTTP client for searching ad accounts

Compare that to this code utilizing the LinkedIn API client. The client abstracts much of the complexities of constructing the request. It allows passing in objects, arrays, and strings with special characters as is, making the code easy to write and maintain. Furthermore, it handles edge cases where query tunneling may be required.

Example code illustrating use of the LinkedIn API client for searching ad accounts
Example code illustrating the use of the LinkedIn API client for searching ad accounts

Using these API clients can greatly speed up and simplify the development process, and make your application code more maintainable and robust. If any issues arise, the corresponding Github repository is available for bug reports and enhancement suggestions. We are looking to expand to more languages in the future and are excited to see the applications you can build with these tools!