headerIMG

B2B Articles - September 07, 2013

Using APIs. How to Incorporate Them Successfully.

Using the APIs really aren't as hard to use as it might seem. Here's how to make use of APIs to do things like gathering data with little or no advanced programming.

openAPIAPIs can seem intimidating and can only be implemented by advanced web engineers. But, in reality many APIs are designed to be implemented easier than might be expected. If taken in small parts, understanding APIs will not seem nearly as hard to understand.

Step 1: Constructing the URL
The first part of incorporating APIs is understand the URL the API is contained in. Each API is slightly different, so review the supplied documentation for the API you’re interested in. Most of the time, the documentation will include examples that can be tweaked to get the desired output.

Here is an example URL the contains an API call.

https://www.ironpaper.com/w/api.php?action=query&list=backlinks&bltitle=Ironpaper&bllimit=10

Break down that URL to see how it’s made up:

  • https://www.ironpaper.com/w/api.php — This is the exact location where the API lives
  • action=query — fetch the data requested in the rest of the URL
  • list=backlinks — list pages that link to a specific page
  • bltitle=Ironpaper — the specific page with the title “Ironpaper”
  • bllimit=10 — limit to 10 results

Step 2: Available Formats
API calls can return a variety of formats depending on the service. Start out by returning the data in HTML or XML format that I to make sure the query is correct and that you're getting the expected results from the API. Other formats, like JSON, download the data to use for other purposes later.

Here's another example for Twitter's GET users/show function, which returns information about a user, such as description, URL, link to profile image, last tweet, count of friends / followers, etc.

https://api.twitter.com/1/users/show.xml?screen_name=geekygirldawn

  • https://api.twitter.com/1 — Version 1 of the Twitter API
  • users — users section of the API to gather information on a user
  • show.xml — display the output as XML
  • screen_name=geekygirldawn — the user that you want information about (geekygirldawn)

Step 3: Rate Limiting
Most APIs have some kind of rate limiting, which means they can only make so many calls to the API from a given IP address in a given amount of time. For Twitter this limit is 150 API calls per hour. This is to prevent people from abusing the API or putting too heavy a load on the servers.

Step 4: API Keys
Some APIs require that you sign up for an API key. This is usually to keep track of requests. Think of it as a password that shouldn’t be shared. In many cases, an API key is what the API uses to rate limit requests.

Step 5: Combination for Power
APIs can be combined to get information that can’t easily be gathered in other ways. For example, combining APIs can:

  • Start with an RSS feed of all Ironpaper posts
  • Take each link and runs it through the BackType API to see who has posted the link to Twitter
  • Then use the Twitter API to see how many followers each person who tweeted the link has
  • Format all of this information into a new RSS feed in the form of “username (num of followers): Tweet text” that can be viewed in an RSS reader

Tel 212-993-7809  

Ironpaper ®
10 East 33rd Street 
6th Floor
New York, NY 10016
Map

Ironpaper - B2B Agency

B2B Marketing and Growth Agency.

Grow your B2B business boldly. Ironpaper is a B2B marketing agency. We build growth engines for marketing and sales success. We drive demand generation campaigns, ABM programs, B2B content, sales enablement, qualified leads, and B2B marketing efforts. 

Ironpaper Twitter Ironpaper Linkedin