API

Collecting, processing, analysing and displaying data on the same interface is excellent! Being able to create these operations from several different interfaces is even better!

The data covers multiple fields and can be adapted to meet the needs of each of the interfaces involved, whilst being kept up to date at the same time. This is what I would call the basic idea of an Application Programming Interface (API).

An API connects different platforms together so that data can be read and/or written. Depending on the platform used, the different actions which can be performed by an API vary greatly.

Let’s take a look at some examples to illustrate the different possibilities offered by APIs.

Example of a widget created with information from the Yahoo! Weather API

Yahoo! Weather

The “Yahoo!” search engine has an API which obtains meteorological information from anywhere in the world by simply entering GPS co-ordinates into the request. The information which is retrieved (e.g. maximum and minimum temperature) can then be integrated into different modules.

Retrieving a map via the Google Maps API

Google Maps

Google has several different APIs which respond to the different needs of an application. One of the most used APIs is the “Maps” API. This interface offers users a wide range of interactions which can be performed on the different maps of the world.

The localisation system used is similar to the one used by “Yahoo! Weather” since it relies on GPS co-ordinates to focus on the map that is to be retrieved. How it works is that a fixed image of the map is retrieved, and tags are then be added to the map to make it interactive by using different parameters.

How do APIs work?

Each operation, or interaction, offered by an API is known as a “method”. The different methods are:

  • Read only: the information is obtained so that it can be processed by the user;
  • Read and write: the data is retrieved for processing. This method is also used to modify, add and delete information;
  • Write only: this type of method adds information, without obtaining information which is already present.

Here is a diagram showing how an API works:

To store the different methods in a logical fashion and to simplify how they are used and managed, they are organised into groups known as “services”. A user may or may not have access to a service, in other words the set of methods that the service is made up of.

How can I access information provided by APIs?

Several different methods for accessing such information exist. Each API is free to offer the method which suits it the best, depending on the information to be transferred.

Below is a list of the main formats used:

Request

 

  • REST: a call to a URL is made, with different parameters so that the request can be refined. This method is used the most, with nearly 75%* of APIs using it. It is very easy to implement, and allows for the quick development of the application.
  • SOAP: this request method requires a more accurate format, and also requires a more substantial call than the REST method. This system tends to be disappearing; I will not go into the technical details on how it is used.

Response

  • XML: the XML format is used the most for API responses since it can carry a large amount of information, whilst adhering to a strict format. 65% of APIs use this data format.
  • JSON: JSON is a rapidly growing format which transfers information in a format which can be easily used in the majority of programming languages, especially JavaScript. The fact that it is easy to use means that applications are quick to set-up.

These different formats are only a selection of formats chosen from many others available. There are currently no standards which exist as far as request and response formats are concerned. Nevertheless, the REST format for requests and JSON format for responses seem to be en route to becoming the standards.

(*)Source: ProgrammableWeb: http://www.programmableweb.com/apis

What does the AT Internet API do?

The AT Internet API, available to customers, allows them to perform a range of different actions including, managing their account and creating analyses. The API allows some customers to manipulate data, or to generate analyses which are relevant to their business. Customers can redistribute data in several different ways: a) internally to guide strategic company decisions and to guide their different teams, b) to their partners in order to provide them with information on the performance of their campaigns, and finally c) to the general public to rely on transparency.

Which services does the AT Internet API have to offer?

AT Internet offers its customers a wide range of different services with read and/or write actions for each so that they can get the most out of the API.

Below is a short description of the two key webservices AT Internet has to offer:

Reporting

The Reporting service is the main service offered by AT Internet, and is also the one which is used the most. This service will retrieve any analysis present on the interface, thanks to the use of an “analysis code” available in each analysis.

There are two different method types associated with this service:

  • Synchronous methods: the data is returned directly in the response to the call.
  • Asynchronous methods: the analysis is generated at the same time as a call is made by a customer, with each call being allocated a “number”. The number which is allocated will then retrieve data via a second call.

The choice to use one type of call or another depends on the quantity of data to be retrieved. The synchronous method is used for low traffic volumes, low enough so that the transfer time is transparent. The asynchronous method retrieves larger sets of data which take longer to be calculated without blocking the application that uses the API when waiting for the data to be transferred.

CampaignSources

The solution offered by AT Internet helps users find out a visitor’s source for all types of marketing campaign such as: sponsored links, affiliation, email campaigns, RSS feeds and Advertising.

Campaigns are declared and managed on the interface. With the CampaignSources service users have a wider range of options for managing marketing campaigns associated with a site. It is possible to:

  • Add a campaign;
  • Close a campaign;
  • Retrieve information from a campaign (or set of campaigns);
  • Update a campaign (by changing its name and description).

This will provide the Marketing service in charge of these campaigns (which may not necessarily have access to the interface) with the opportunity to easily, if not automatically, declare campaigns as they are being launched.

As we have just seen, APIs are important elements in managing information, and can form part of real applications, by reprocessing only the data that is provided by the different APIs.

By integrating the APIs separately into internal tools, we can benefit from all of the advantages that a SaaS solution has to offer.

This type of interface may turn out to be decisive in the strategic and operational management of a campaign, a site or even a company. It is therefore very interesting to take the time to study the possibilities offered by the different APIs relative to the market in which a company is growing to obtain the data which can then be integrated into an internal information system, and which in the end will help the decision-making process.

 

Author

Web Analytics Consultant With a real passion for the Internet for a number of years now, Benjamin is a real jack-of-all-trades as far as new technologies are concerned. His growing desire led him to teach himself programming languages such as PHP, JavaScript and HTML 5. It was during his initial training in Services and Communication networks that Benjamin discovered the world of Web Analytics. This was followed by a sandwich degree in e-Commerce and e-Marketing Project Management during which Benjamin joined the AT Internet team. After graduating, he decided to stay with us, and today works as a Web Analytics Consultant where he assists AT Internet customers. His versatility and flexibility allow him not only to resolve technical related issues but also to respond to any data-analysis related questions.

1 Comment

  1. Whether it is interfaces or internal libraries, all codes must be unambiguous to
    every project participant. This is more important in the case of externally visible codes that must be
    written according to prevailing standards.