In this tutorial, you will learn how to connect the Linkedin API to Google Sheets in 7 steps:
Apipheny is an API connector for Google Sheets. You can use Apipheny to connect your Google Sheets to unlimited API data sources, make unlimited API requests, and more. There is a 30 day free trial included.
1.) Install Apipheny by opening the following link on desktop and then clicking the Install button in the Google Marketplace: https://apipheny.io/install
2.) After you’ve installed Apipheny, open a Google Sheet and then click on the Extensions dropdown in the menu at the top.
In the dropdown list you should see Apipheny. Click Apipheny then click Import API to open the Apipheny sidebar in your Google Sheet.
Tip: you can open a new Google Sheet by entering this URL in your browser: sheet.new
In your developer account, click the My Apps menu item, then click the +Create app button:
Complete all the required fields, such as App name, LinkedIn page and App logo:
Check the terms agreement checkbox and then click the Create app button:
Your app will then be created:
Click the Auth tab to find the Client ID and the Client Secret:
Copy and paste your Client ID and Client Secret to a safe location, because you’ll need them in the next steps.
To get your Linkedin authorization code, copy the following link, then go to your browser’s address bar, paste it, and press Enter:
https://www.linkedin.com/oauth/v2/authorization?response_type=code&client_id=your_client_id&redirect_uri=your_redirect_uri&state=abcd&scope=r_liteprofile%20r_emailaddress%20w_member_social
Next, you will be asked for a list of required permission and you will have to click the Allow button:
After you allow access to the app, your code will be displayed in the address bar, as a value for the code parameter of your API URL:
Note: This code is only valid for 20 seconds. Make sure you follow Step 4.) below, to exchange the token, within these 20 seconds.
To generate a Linkedin API access token, you’ll need to issue an HTTP POST request to the accessToken endpoint, with both your Client ID and Client Secret values.
Open up a terminal window and compose the following curl command:
curl -X POST https://www.linkedin.com/oauth/v2/accessToken \\ -d "grant_type=authorization_code&code=CODE&redirect_uri=REDIRECT_URI& client_id=CLIENT_ID&client_secret=CLIENT_SECRET" \\ -H "Content-Type: application/x-www-form-urlencoded"
You’ll need to replace 4 of the values in this command:
You should receive a response containing an access token, make sure to copy it and save it in a safe place.
In this section, I’ll show you how to browse the LinkedIn API documentation to find an API endpoint URL that retrieves the specific information you need from your LinkedIn account.
If you already know your API URL, or you want to use the same example URL as us, just skip to Step 6.
First, open the LinkedIn API documentation page: https://docs.microsoft.com/en-us/linkedin/
The menu on the left contains a list of available API solutions (Compliance, Consumer, Learning, Marketing, Sales, and Talent):
Clicking one of the available Linkedin APIs (e.g Marketing) will open a dedicated page, with more details about the concepts and operations provided by that solution.
These are organized using a menu on the left of the page, from which you can access more information about Development, Integrations or API References.
For instance, in the Marketing solution’s Integrations section, you’ll find a list of concepts used by this API:
An example Marketing integration concept is Ads. This concept’s menu lists multiple supported objects and operations, grouped under Account Structure and Advertising & Targeting.
The Ad Accounts menu item, in the Account Structure group, lists multiple supported operation endpoints. One of them is Search for Accounts, which allows the user to search for accounts by multiple criteria, such as their IDs, names, references, types and statuses:
https://api.linkedin.com/v2/adAccountsV2?q=search&search.{searchCriteria}.values[0]={searchValue}
The documentation for this endpoint contains a short description of the endpoint’s purpose, the HTTP method and URL, a table of the accepted parameters, as well as a sample request and its associated sample response:
Okay, we’re in the home stretch. Now go back to your Google Sheet and make sure that the Apipheny add-on is open on the “Import” tab. With the Import Tab open, enter these details into the add-on:
Method: At the top of the Apipheny sidebar, select the HTTP method (GET or POST) as required by your LinkedIn API endpoint. For this example, we are using the GET method.
API URL: In Step 5, I explained how you can find the LinkedIn API endpoint that you need. Now copy the complete API URL into the Apipheny add-on, where it says API URL Path, followed by any GET parameters required for your query.
For this example, we are using the “Me” endpoint, that gets information about the current user’s account. The corresponding URL for this endpoint is:
https://api.linkedin.com/v2/me
In the Headers section of the Apipheny add-on panel, add one row, with the following key and value:
Header Key: Authorization Value: Bearer your_token
Replace your_token with the value of the token you obtained previously, in Step 4. There should be a literal space between Bearer and your_token.
The last step is to click the Run button at the bottom of the Apipheny add-on and then your LinkedIn data will be imported into your Google Sheet.
After making a successful request to the LinkedIn API, try querying a different LinkedIn API endpoint, or try using one of the more advanced features in the Apipheny add-on.
Make a GET request
Make a POST request
PUT, PATCH, & DELETE Requests
Save requests for later
Schedule requests for automatic updates
Reference cell values in requests
=APIPHENY custom function
Stack multiple URLs in a single request
Run all saved requests at once
Modify your request settings
Import & export saved API settings
Ahrefs API
Airtable API
Alpha Vantage API
Asana API
Binance API
Clickup API
Coingecko API
Coinmarketcap API
Coinbase API
Constant Contact API
Discord API
Drift API
Etsy API
Eventbrite API
Facebook Graph API
Facebook Ads API
Figma API
Github API
Google SERP API
Hubspot API
Hunter API
What is an API?
What is an API URL?
What are parameters?
What is an endpoint?
What is an API key/token?
What is basic authentication?
What are headers?
What is a GET request?
What is a POST request?