Modthink - What is API

What is API, and Why Should I Understand It?

The Definition of API

API stands for Application Programming Interface. It is a form of communication between computers through a given URL, which serves as a technological pathway.

Along this “path,” the subject, searched by a user, needs to be specific in order to receive useful results. (We’ll get into what this means and how it can enhance your marketing strategy.)

To begin, there are four parts:

  • Client
  • Network
  • Server
  • Documentation

In order to improve your understanding, let’s break it down. Imagine a restaurant. 

In this particular scenario, the client is the equivalent to a customer placing a food order. The network represents the waiter taking the customer’s order and relaying it to the kitchen. Finally, the kitchen is the network server, returning the customer’s order or “data.”

Keep in mind that the customer can only order from the menu (AKA the documentation for the given API) of that particular restaurant. Similarly, the client must choose specific words to receive their desired information from a particular website.

How is API Helpful to Marketing?

Moving on to why you’re even reading this article in the first place: let’s look at how API relates to marketing. API can give great insight into analytics and create content for posting. In addition to that, API can showcase how each individual affects the company’s results. 

These benefits are best seen through the following processes: automation, analytics, and batching. 

To start, it helps to have clean, organized data that can be plugged into a dashboard for clients. This ties in with automation.

Once a dashboard is built, the data can auto-refresh at certain time intervals, providing great insight to clients. Your analytics can be improved after running spell checks or SEO checks via certain APIs.

As for the batching process, this is where you can schedule when and where certain posts will happen. Essentially, this process organizes and defines your company’s larger problems, goals, and ideas. 

Now, let’s see this in action!

Example of LinkedIn Video Analytics API

For this example, I’ll be using the LinkedIn API for company video analytics.

API linkedin video walton supply chain example

The LinkedIn API has four different video return values:

  • video display
  • viewers
  • time watched
  • time spent on video views

Let’s focus on the Walton Supply Chain Management LinkedIn page, which includes a time watch metric.

The time watch metric returns view time in milliseconds. The goal for Walton’s example is to use the LinkedIn API as a means to create data visualization, which includes time watched on this post between the dates of 1/24 and 2/27. 

Requirements for LinkedIn’s Video API

To begin, you will need to set up an app on the LinkedIn Developers website. Going back to our restaurant metaphor, this app is essentially an invitation to go to the restaurant.

Here is a link to the official documentation on how to set up for keys and tokens.

A LinkedIn requirement is that the API user must be either a direct sponsored content post or an administrator. Another requirement is having r_organization_social permission from the LinkedIn API. 

Getting the Right Ingredients for Your API Set-Up

There are three different options for setting up your APIs.

  1.; A python package for http requests.
  2. Python 3.7.4; This is what I use and highly recommend.
  3.; A python package for creating graphs. 

An easy way to convert dates into the correct epoch language is through this link. This makes the time and dates easier for the API to receive. example graphic

To finish gathering the correct ingredients, the final parts you need are your Company ID and your Post ID.

company and post ID parts needed

A Deeper Look into What a URL Is

Below is the URL that the API is linked to. I currently have the start of the time range set at StartDate. The end of the time range is EndDate. 

<ifram src-“″ height=”1026″ width=”504″ frameborder=”0″ allowfullscreen=”” title =”Embedded post” ></iframe>

What are “Params”?

“Params” is short for parameters. These are what the client is specifically researching. 

example of params for API

This is essentially a statement of what we want and the process of receiving it. In the LinkedIn example above, the param is the post idea that was previously stated. The type is TIME_WATCHED. We want it to give us daily data, but it can also be done monthly or through a running total. 


headers and line numbers when creating an API

When creating headers, use lines 31 – 38. Headers set the rules of how information is passed through the internet. The most important one is authorization. This is where the access_token is given. The best practice is to save it to an environment variable, which can only be accessed by the current client.

In lines 40 – 43, we request the video statistics by giving the URL, parameters, and headers. From here, we receive a list of data by day. 


Are you still with me? Hold on, we are nearing the end!

results of print output of time watched

Each day has the same data, statistical type, value, entity, and time range. What we find valuable is the value and the end in the time range. The value is the time watched on that date in milliseconds.

The end of the time range is the same as the end of the day. This is helpful to use given conflicting time zones. If I use the start of the day as my time range, my data set would be shifted by one day. 

API results and line number example

From lines 48 to 52, I will loop between each video’s data and create two separate lists: one for dates and one for time watched.

In lines 55 – 58, I will set the list of time watched on the x-axis (“Dates”) and the time watch list on the y-axis (“Time Watched in Seconds”) of the bar graph.


From 1/24 to 2/27, this bar graph displays how much time was watched in seconds. Using this data visualization, we can tell that it was watched at a consistent rate for 12 days.

bar graph displays time watched in seconds on LinkedIn video

Final Thoughts

To wrap this up, my most important takeaway for you is to make sure to showcase the important stuff!

I chose this particular Walton video as an example, but you can research plenty more. This will help you compare different posts and their performance.

When using API to track your engagement, have a good understanding of which videos receive constant views. Knowing the content your audience wants to see is essential to your marketing strategy.

Soon, API data analysis will change the game with its ability to automate and create daily, weekly, or monthly metric reports.

If you have any more questions or comments, send me a message on LinkedIn. Be on the lookout for more digital marketing content on the website or check out Modthink’s LinkedIn.

Share this post

Share on facebook
Share on twitter
Share on linkedin
Scroll to Top