CC 5018 en

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Application Programming Interface (API) – Everything you need to know

2022
FAO Agroinformatics | New CSI documentation on APIs for web

The ABCs of APIs – Everything you need to know

What is an API?

API stands for Application Programming Interface (API) – and the keyword here is interface. In
other words, APIs allow two or more digital applications or services to share data and
information. Most people use APIs everyday without knowing it. Each time you use an app on
your phone or computer, you are using an API to send data and/or information from one app to
another.

How does an API work?

When developers decide to make some of their data available to the public, they expose
endpoints – essentially, they publish a portion of the language they’ve used to build their
program. This allows other developers to pull or retrieve data from the application and host it in
another application entirely.

For this reason, if data is made available to the public, commonly referred to as open data -
anyone can access the data using an API call which allows you to retrieve a piece of data - or
resource - using a specific URL from one digital application or service to another, allowing the
receiving application to show the data or information in their application.

Quick terminology crash course: an API call sends a specific request – usually using a URL
– that pulls or retrieves the resource (the requested data or information) and when the
requested resource is sent back, it is called a response. This is how two separate web
applications or services communicate using APIs.

How are APIs used in the Hand-in-Hand (HiH) Geospatial Platform?

The HiH Geospatial Platform heavily relies on communication between multiple APIs to allow
different components to interact with each other, resulting in the numerous services available to
users.

This includes API requests from existing FAO digital applications and services that host
numerous subregional, regional and global data and information as well as API requests from
non-FAO digital applications – these are often referred to as external API requests.
External API requests are a key component of the HiH Geospatial Platform because they allow
FAO developers to integrate data and information from existing digital services, already hosted
somewhere on the web – and make them available in one place.

Time to get more technical – are there different kinds of APIs?

Yes, there are two main kinds of APIs. The most common open API architectures fall into two
categories: REST APIs and SOAP APIs.

Learning about SOAP and REST APIs may seem more technical or more complex at first
glance, but just remember that they exist to minimize confusion when assessing existing
resources and how easy they are to integrate or note depending on what kind of API is being
used.

SOAP API vs REST API

Representational State Transfer – or REST API still enables two digital applications to talk to
each other, yet adds a component of order to the whole system. These rules are set out by the
REST architectural style and serve to create standard protocols for what APIs should look like
when they are created by developers. An example of one of these rules is that you should
always be able to pull data and information by linking to a specific HTTP URL – no matter where
you are in the world or on the web.

You can find REST-based Web services that output the data in many different formats:
Command Separated Value (CSV), JavaScript Object Notation (JSON) and Really Simple
Syndication (RSS). The benefit of REST APIs is that they offer multiple response formats and
this makes it easier to integrate data and information from two different web applications.

On the other hand, Simple Object Access Protocol – or SOAP API relies solely on one format
to send and retrieve data and information from other web applications. This format is XML.

Standardization and Data Protocols

Now that we know the ABCs of APIs, there are also important protocols to adhere into in the IT
community. These serve to standardize the way a service may consume or produce messages
or information shared with other services.

One example of this is the seamless integration in the HiH Geospatial Platform of
GoogleEarthEngine (GEE) maps due to the OpenGIS Web Map Tile Service (WMTS)
implementation standard. The HiH Geospatial Platform makes use of these standard geospatial
protocols to simplify all back-end interactions and data integrations.
Additional links:

★ Standard geospatial protocols: Open Geospatial Consortium (OGC).


★ OpenAPIs vs Swagger:
https://smartbear.com/blog/what-is-the-difference-between-swagger-and-openapi/
★ Swagger OpenAPI specifications https://swagger.io/specification/

Disclaimer

Links to other websites are provided for the user's convenience only and do not constitute endorsement
by FAO of material at those sites, any associated organization, product or service.

You might also like