Search API Connector Documentation
Import LinkedIn Pages Data to Google Sheets
In this guide, we will pull data from the LinkedIn Organization (aka Pages) API directly into Google Sheets, using the API Connector add-on for Sheets.
With this connection you should be able to retrieve most of the metrics available to you when you click the Analytics tab while logged into the admin section of your LinkedIn company account. You can also access limited public data about other organizations.
- Before You Begin
- Part 1: Connect to the LinkedIn Pages API
- Part 2: Get your Organization ID
- Part 3: Pull Data from LinkedIn Pages to Sheets
- Part 4: Handle Dates
- Part 5: Create a Custom Request
- Part 6: API Documentation
Before You Begin
Click here to install the API Connector add-on from the Google Marketplace.
Part 1: Connect to the LinkedIn Pages API
The easiest way to get started with the LinkedIn Pages API is through API Connector’s built-in integration.
- Select LinkedIn Pages from the drop-down list of applications
- Under Authorization, click Connect to LinkedIn (if you haven't already).
- You will be directed to LinkedIn and asked to authorize the connection. Click Allow.
- You’ll now be returned to your Google Sheet, and can verify that your LinkedIn API connection is active.
Part 2: Get your Organization ID
Get your organization ID by looking in the URL while logged into your LinkedIn company page.
Note this ID as we'll need it for our requests.
Part 3: Pull Data from LinkedIn Pages to Sheets
Now that we’re connected, let’s pull some data into Sheets.
- Under Endpoint, choose
/organizationPageStatistics?q=organization. This will return pageview stats about your organization's LinkedIn page.
- In the Request parameters section, click the
organizationparameter and select your organization ID from the dropdown menu.
- The other required parameter is
timeIntervals. Choose a start and end date, as well as a time breakdown (day or month).
- Select a destination sheet, name your request, and click Run. A moment later you’ll see a lot of information about your LinkedIn page populate your sheet. This report contains pageviews broken down by multiple facets (device, industry, etc).
- To filter for just the fields you need, click Edit Fields to open API Connector's visual field editor. There you can filter out all the columns you don't want to see in this report.
Part 4: Handle Dates
The LinkedIn Pages API uses UNIX timestamps. Here's how to see "standard" dates in your sheet instead.
- Set your destination cell to B1. This will give us space in column A for a formula
- Add this formula into empty cell A2 (just change BR to whichever column contains elements.timeRange.start):
- You should now see your data broken down by human-readable dates (use Sheets' built-in date format picker to select the exact format you want).
Part 5: Create a Custom Request
Alternatively, you can create a custom request instead of using API Connector’s built-in integration, using any of the endpoints and parameters shown in the documentation. Here's an example request setup. Substitute in your own organization ID where it reads
- Request URL:
Part 6: API Documentation
Official API documentation: https://docs.microsoft.com/en-us/linkedin/marketing/integrations/community-management/organizations/page-statistics
To view or manage the API Connector connection on LinkedIn's side, click this link: https://www.linkedin.com/psettings/permitted-services
6 thoughts on “Import LinkedIn Pages Data to Google Sheets”
I'd like to create triggers for LinkedIn Pages requests to run daily. Is there a way to set a dynamic date range (always yesterday) for these requests? And if so, is it necessary to create a custom request or can it be done directly in LinkedIn Pages?
Greetings and thanks.
Hey Luis, for now you need to do this as a custom request. I think the easiest way will be to set up your request using the LinkedIn Pages preset connection, then tick the "Add request URL" option under Output options > More options before you run it. That way you can see your whole request URL and copy/paste it into a custom request. Then instead of hard-coding in the dates, reference cells containing dynamic dates as described here. That article has an example of how to include dynamic dates in your request.
Update: you can now reference dynamic date cells through the preset integration too, not just through custom requests.
Is there a method to call post data? e.g. post text, impressions, engagements, shares, clicks, etc.
Good question. Unfortunately the LinkedIn API is really lacking in functionality (and documentation). You can get a list of posts using a request URL like this:
https://api.linkedin.com/v2/ugcPosts?q=authors&authors=List(urn%3Ali%3Aorganization%3A6447845)&sortBy=LAST_MODIFIED&count=100. However that list doesn't come back with any useful engagement data, and their documentation doesn't seem to indicate that this data is available. I'll update this post if I find anything different.
Is there a way to pull LinkedIn recruiter leads into google sheet via the api connector?
Hi Lixx, sorry, the Recruiter System Connect endpoints are restricted, and we don't currently have access to them.