Skip to main content

Everything you need to know about APIs – part 2

By January 6, 2022February 10th, 2022FME

Application Programming Interface (API) is a contact and communication point for different web services. APIs allow a totally new and safe way of using data and have started a revolution in the way services are provided. APIs are now indispensable, if we are thinking of creating new services and succeeding on today’s extremely competitive and dynamically evolving and changing market.

Why create APIs?

APIs are nowadays treated like a commodity. Entire hubs are created that offer ready-made APIs aligned with the requirement of different industries and different purposes. APIs are provided by many different companies, among the most popular like AWS or Azure. The problem lies not in creating APIs but in how to connect them with data.

This task may seem complicated and sometimes requires changes in the source code. At least this is what the process used to look like before tools that enabled a simpler way of using APIs. One of them is FME Platform. Using it, you can connect to different data sources through an API, without the need of writing code.

Is using an API without coding the right solution for me?

The possibility of creating and hosting an API without using code seems like the best possible option – we connect APIs with data sets through several operations, and, without programming, we get a secure and steadfast connection. Unfortunately, there are situations in which this, otherwise extremely comfortable solution, will not be the best choice. 

It is good to ask yourself at the very beginning, some important questions that will make it clear if a codeless API will suite your needs. Although it is a tool that comes with many benefits and possibilities, it also makes any changes that you would like to make with the hands of programmers, much more difficult.

A codeless API is for you, if:

  • You have no programmers on your team and want to handle the entire process through a GUI (Graphical User Interface).
  • A fast solution is what you are after. You will most likely use the API in a single project, so the option of implementing changes later on is not important to you.
  • If you are building a prototype of a service – instead of providing the users with a beta version, you can take advantage of an API. If you are able to convince the users to include your API into their daily routine, the chances that they will stick with you are much higher than if it were a test version of your service.

Serverless and codeless APIs will not do the job, if your goal is to create complex APIs, which will be used to support a vast number of users and millions of requests. Such solutions require much more control on your behalf, and the possibility of free optimization, and so the interference of programmers.

The use of APIs in FME

Data migration involving an API and a tool such as FME, runs according to several general steps (which we described in detail in the first part of the article), yet the toolset and the functionalities that FME has in store makes the migration and the integration of an API simple and fast.

FME allows to:

  • create workflows using a visual programming language that utilizes transformers,
  • observe data while working on it,
  • send API calls,
  • create connections freely,
  • build flexible and repetitive processes.

What FME functions support creating and using APIs in FME?

Let’s take a look at the most useful and the most popular transformers in FME, that help to use APIs in the data migration process. Transformers enable reading data in the workflow, help control it and fix if need be. Several transformers play a vital role in bulk data migration with the use of an API:

  • HTTPCaller – the HTTPCaller transformer allows you to make a request to a specific URL, use Web Connections with stored credentials, send message content, and even make dynamic requests based on data in the workspace.
  • JSONTemplater – it is common for data and information made available through APIs to be stored in JSON format. JSONTemplater allows you to generate properly formatted JSON for requests based on FME attribute values.
  • FeatureMerger i FeatureJoiner – these transformers are essential for combining related features, datasets, and metadata from various sources. They are especially useful when you need to combine data from API queries with local data or data from several API queries.
  • Sampler – helps narrow down the data to a selected subset for testing and validation before you use the entire data in the API.
  • AttributeManager – is a transformer with a very wide range of uses. It can be used for schema mapping, attribute cleanup or field calculations. When working with APIs, it is common practice to build URLs, requests, and even query parameters using the AttributeManager transformer before sending the request using HTTPCaller.

Tools enabling visual data inspection – this is a set of features that together allow you to track live data in preview and anywhere in the process. This allows you to build a step-by-step workflow and test and fix individual transformers without losing sight of the changes being made.

Authentication tools  – a key part of working with APIs is authentication. Web Connections allow authentication through the most common forms: token, OAuth 2.0 or HTTP Basic.

Where can an API be used?

Companies and institutions provide access to their services, data, or information, through APIs, that can be downloaded from their websites. After connecting via FME (or adding a code to the website), you can use services by that provider or make this service available on your own website.

Let’s look at some examples.

Narodowy Bank Polski

On the NBP website you will find an API that allows you to retrieve information about the average exchange rate and the prices of gold. Each API has a description saying what its use is, what each element means and how to build a request to use the API on your website.

Thanks to the APIs available on the NBP website you can keep track of the average exchange rates of selected currencies, as well as to perform more detailed operations, e.g., check the average exchange rate for a selected period.

Templates of requests about a single, selected currency 
An example of a request about the current exchange rate of the Swiss Franc (CHF)

Airport Info

Thanks to this API, with several simple operations, you can download and display on a map the localization of all the airports that you are interested in, along with all the basic information: the full name, address, website, geographical coordinates. Requests about an airport are created based on the international airport code list – IATA and ICAO

Airport info API Documentation

GIOŚ (General Inspectorate for Environmental Protection)

The General Inspectorate for Environmental Protection shares on their website APIs that allow to observe the level of air pollution in Poland. They provide general data for all the measurement points, as well as more detailed data sets for every localization.

Sharing the list of air quality measurement stations of the Chief Inspectorate of Environmental Protection
Sharing data from a selected measurement station and reading the values for individual pollutants.

Learn more about the APIs described and how to use them from the webinar recording (in Polish): How to connect to any API without coding

The widespread use of APIs has initiated a whole new way for software to communicate and has become a steppingstone to the era of sharing and building a digital world that is a network of interconnected systems. Data has become widely available, and APIs function as a gateway to a company’s resources that can be shared securely. This provided space for innovation and initiated an exponential development of new services. Today APIs are no longer a technological novelty but a basic tool for creating services.

APIs give us the freedom to choose the best services and applications to fit our needs. Thanks to APIs and data processing technology, such as is offered by FME, we are not limited to one system and can freely choose services that best fit our current needs.

APIs are indispensable if we are thinking about business development, so it is worth getting to know them better. It’s also good to look into the tools that are used to create them, the possibilities they provide and know what limitations come with their use.

Are you wondering if using API and FME makes sense for your business? Do you want to learn more about the possibilities of the Platform? Our FME experts will be happy to answer all your questions.

Let’s talk about your challenges