One example of this is mobile apps like Mint that retrieve financial data from banks. Another example is a website that retrieves new posts from your Facebook and Twitter accounts and portrays them all in one web app. APIs make it very easy for developers to consolidate data from different services into one user interface or app.
What is An API?
To understand how an API works, its important to understand how applications work over the web. When the creators of a service (like Google Maps) want to create an interface for programmers across the world to use to get data, they’ll create either a SOAP or REST interface. SOAP stands for Simple Object Access Protocol (SOAP). REST stands for Representational State Transfer. Both protocols perform the same sort of actions. They receive requests from any application and provide a response to those requests.
The structure of the data transfer follows an architecture known as JSON, which stands for JavaScript Object Notation. JSON is what’s known as a “data interchange”. Simply put, it’s a way programmers can request information in a human and machine-readable format.
How an API Works
JSON is a standardized way that programmers who create the API and those who use it know how each of their applications can “talk” to one another. JSON data is usually a collection of name and value pairs. Programmers can send these as requests to an API for data, and the API will respond with values in the response JSON object. The order of events is as follows: Information can be passed to or from the API. For example, an application could send the Facebook API post information that includes the user’s login details, and the post text. The Facebook API would receive this request and process it, publishing the post on that user’s Facebook wall. REST allows application developers to use a variety of formats for messages, including HTML, JSON, XML, and even plain text. SOAP APIs only allow XML formatted messages.
Examples of API Applications
What are some of the most popular web APIs in use today? There are mobile and web apps that allow users to interact with social platforms, check the weather, integrate with maps, and more. These apps use APIs to reach out to remote services and retrieve or post data. The following are a few examples of some of the most APIs that programmers access for their apps.
Weather Underground API
One of the most popular uses for web applications is to retrieve weather information. One of the most popular online API weather services for programmers is Weather Underground. You can see this API in action using the IFTTT web service. Here, you’ll find a variety of Weather Underground triggers and actions.
Each of these makes use of API requests to the Weather Underground service. Through IFTTT you can use various weather alerts and events to trigger other actions, like SMS messages or emails. Another popular weather API service used by programmers is the OpenWeather API.
Skyscanner Flight Search API
Another popular use of API technology is for travel-related apps. Many mobile and web apps need to retrieve travel information like flight status or flight and hotel deals. The Skyscanner API brings this information to applications via simple web requests. For example, the Scoot trip planning website and mobile app make use of the Skyscanner API for their trip search user requests.
Without access to an external airline API, Scoot programmers would have had to build their own database and retrieve the information from various airlines. By using the Skyscanner API, programmers were able to focus on their trip planning web application, and leave the flight search heavy lifting up to Skyscanner instead.
Yahoo Finance API
The Yahoo Finance API is now known as RapidAPI. It allows any external application to retrieve stock quotes, financial reports, stock press releases, and more. By sending requests to the API, programmers can retrieve a wide variety of stock market information, even including stock charts.
Easy access to stock information is invaluable for programmers who want to develop mobile financial apps but don’t have access to tap into various market databases. By using an API like Yahoo Finance, programs can access the consolidated data from all markets, with an easy API request.
Bitly URL Shortener API
One of the most common actions for sites like Twitter or Facebook is shortening URLs to make posts shorter. Bitly has been a leader in this area for years. So, it makes sense that the URL shortening service would also be available via a Bitly API. This means application developers can embed the Bitly URL shortening service into their own mobile apps or websites. One example of this is Zapier, an online service that helps to integrate various online services with one another. Zapier uses the Bitly API to let its users integrate their Bitly account with any other online service they may have.
For example, you can trigger new automation when you create a new link using Bitly. This could instantly send the link to a Google Docs document or Google Sheets spreadsheet. You could even have Zapier instantly send the URL to an Evernote Notebook. All of these integrations are possible because Zapier programmers can make use of web requests to the Bitly API.
Google APIs
Google offers so many APIs that they offer a Google APIs Explorer to find them. A few examples of the most popular Google APIs include:
Analytics Reporting API: Provides access to a user’s own website Analytics data.Calendar API: Retrieve or post events to a user’s Google Calendar.Google Docs API: Read or write to or from Google Docs documents.Gmail API: Access user Gmail accounts and send or retrieve emails.Google Sheets API: Read or write to a user’s spreadsheets in Google Sheets.
You have easy access to these APIs from within your own Google account. All you have to do is learn how to write Google Scripts, and you have access to the entire family of Google APIs for your own Script applications. For example, using the Gmail API, you could write a script to send an email via Gmail using the information in a Google Sheets spreadsheet.
Social Media APIs
Social media platforms were probably some of the first online services to create APIs. These were created so that third-party developers could write mobile or web applications to send posts to a user’s social account. These APIs still exist and developers are adding new features to them constantly. Some examples include:
Twitter APIFacebook APIPinterest APIInstagram APIReddit APITumblr APIYouTube API
These are just a few examples of how major companies are using APIs to open up their services to application developers around the world. Because the future of the internet depends on the integration of platforms and services, APIs are a core driving force for the advancement of future applications and technologies. In fact, many of the mobile apps or websites that you use today are probably using many of the APIs listed above, and you may not even realize it.