The marketer's guide to APIs
Published June 28, 2017, updated February 15, 2022
Summary - APIs (Application Programming Interfaces) shouldn't be scary. Read a short guide to APIs built for marketers, by marketers.
If there’s one thing that is fast becoming an essential skill for data-driven marketers, it’s knowledge of and ability to work with APIs (Application Programming Interfaces).
And if that term has you running for the hills, I can assure you it's not as scary or as difficult as it may seem.
Here’s the thing: it’s really hard for most marketers to point to an objective and say, "Aha, this is why I need to learn APIs.”
Sure, we hear those famous stories of successes, such as Airbnb's growth hack coup that utilized Craigslist's API.
But what about us mere mortals?
I think I have an answer: reporting. APIs allow apps to talk to one another. Imagine having a new person added to your list in Marketo as soon as you create a lead or contact in Salesforce.
This may not be the business-defining growth rocket ship you’d hoped for, but it’s a start. And you can save yourself a heck of a lot of time by using APIs to do reporting and dashboarding because with APIs you can:
- Setup automated connections to services across the web
- Access data sets that aren’t always available via standard reporting interfaces.
The basics of APIs from a marketer's perspective
The gist of this post is that I’m going to provide a basic 101 approach to what marketers could benefit from knowing about APIs. I'll use a few examples that most of us browsing the web will at least have a passing familiarity with.
This post will also provide the background information for your future API explorations, so you feel confident in your knowledge when it’s time to dig deeper.
Here’s what I’m going to cover:
- What is an API?
- Client-Server Model
- How do URLs work?
- How do APIs work?
- Building with APIs
What is an API?
Let’s just cut to the chase. Here's a simple definition: an API is a method for specifying how services should interact and communicate with web-based applications.
The easiest way to understand an API is as an analogy
Here’s the best analogy of an API I’ve heard. An API is a waiter at a restaurant. The waiters job is to communicate your order from you, at your table, to the kitchen, where the food is made, and then bring it back to you.
This is exactly how an API works:
The Waiter (API) takes your order (the request) from your table to the kitchen (the system) and returns with your food (the response).
How this works for a Facebook share link
APIs are most commonly used by developers to design products that use or integrate with a particular service. A good example is Facebook.
If you're reading this post on your computer, you'll notice that there's a little sidebar with social media icons, including Facebook. Well, by clicking on the Facebook icon, you can automatically share a link to this post in your Facebook feed.
This is done via the Facebook API. Share this post, get your hands dirty!
When I was first introduced to APIs, I found it easiest to take a step back and look at the roots of an API. The Client-Server Model is the software architecture that defines your normal web browsing experience.
As a client, your web-browser initiates requests to servers which in turn respond with the information you requested. One of the most basic requests is to display a web-page. This is done using a URL request. This is exactly what happened when you clicked to see this blog post on our website!
How do URLs work?
APIs work in much the same way as a URL does, so it's useful to brush up on how a URL works. A URL is made up of a number of parts which allow the client (you) to communicate what information you'd like to retrieve from a server (a website).
Think of URLs the same way as you would the way you organize files on your computer. By referring to a location, such as "/desktop/my-folder/image1.png" you are able to access an image file from a folder on your desktop.
Here's the basic breakdown of the parts of a URL
- Protocol: This specifies what type of file transfer protocol is being used. HTTP is most common, but you can also use FTP or other protocols.
- Host/Domain Name: This specifies the web server that is being requested. The server is where all the files associated with a website are stored.
- Top Level Domain (TLD): This is used to distinguish between different types of sites. TLDs can be used to denote different types of organizations (.edu vs .gov) or specify country codes (.ca vs .au).
- File Path or Resource Location: This specifies what file to retrieve from the server. Resource locations typically refer to folders within your website’s structure. For example, you can find the Klipfolio blog by going to (/blog.html)
How can I use an API to retrieve data?
This is where things get interesting for us marketing folk, since it's one of the simplest use-cases for APIs.
So, just as a URL processes a request where you (the client) ask the website (the server) for a specific web resource like a blog post, an API also requests information. But, APIs can be much more clever. You can request data in an open-ended way, because it's often not possible to know what specific data is associated with a resource.
To understand how APIs can do this, let's take a look at an example request URL.
How does a request URL work?
Much like any other URL you may plug into your web-browser, a request URL specifies what type of information you want from a service. Let's take a look at a breakdown of an example request URL.
- Base URL: Like the Host/Domain Name, this specifies the server that is being initiated. The Base URL will be the same for every request you make from that specific service. You will add elements to the Base URL, but never modify it.
- Method / Resource Location: Like the file path, this specifies the folder or file location of the data you want to retrieve from the service. This can be more or less complicated depending on the service (see below). If you think of the API as a filing cabinet, then the Method / Resource Location picks up the specific file that you’re looking for.
- Parameters: Like the method or resource location, the parameters identify what type of data you want to retrieve from the service. Since you are retrieving a data file, parameters are used to populate what types of data to retrieve.
Some bonus elements to keep on your radar
I included a few other elements in the above URL image. Here's an overview of those elements:
- API Version: You may need to specify what version of the API you are using in the request URL. If you receive an error processing the request, check that service's developer docs to see if you're using the right version (and what other changes may affect the request).
- Authentication: All APIs require some form of authentication before you can complete your request. Some services use OAuth, while others provide you with a unique API key to include in the request URL.
- Data Format: Some APIs require you to specify the data format in the request, while others simply provide a single data format for all requests.
To help this all sink in, listen to Nikta Kanuka, our Product Manager for Content and Integrations, breaking it down:
Building with APIs
Klipfolio’s Integration Gallery is a great stepping stone for people unfamiliar with APIs. As a marketer, you'll see that our library is overflowing with your favorite services.
Services in the Integration Gallery have a user-friendly interface that makes it much easier to perform an API request.
This is because we provide you with ready-access API documentation for that service and a sample Query URL so you know exactly what you need and what goes where.
Once you’ve retrieved the data you need, save it as a Data Source and start building your Klip. Since you’ve saved your data source through an API, your Klip will automatically update—just add it to your dashboard, and you’re done!
For a deeper dive on APIs, check out this video about Rest APIs:
Still have questions about APIs? Reach out to our friendly Support team, they are happy to chat with you!
Start your analytics journey with instant metrics
By Jonathan Taylor — June 8, 2022
How to: Create calculated metrics in PowerMetrics
By Jonathan Taylor — May 5, 2022
Klipfolio's Jon Taylor: Is the MQL right for my business?
By Emily Hayward — April 1, 2022
What are HubSpot lifecycle stages?
By Jonathan Taylor — March 14, 2022