Nothing Special   »   [go: up one dir, main page]

Introduction To APIs - GeeksforGeeks

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

1/12/2021 Introduction To APIs - GeeksforGeeks

Introduction To APIs
Difficulty Level : Medium ● Last Updated : 17 Jan, 2019

What is an API?

API is an abbreviation for Application Programming Inter face which is a collection of

communication protocols and subroutines used by various programs to communicate

between them. A programmer can make use of various API tools to make its program

easier and simpler. Also, an API facilitates the programmers with an efficient way to

develop their sof tware programs.

Thus in simpler terms, an API helps two programs or applications to communicate with

each other by providing them with necessar y tools and functions. It takes the request

from the user and sends it to the ser vice provider and then again sends the result

generated from the ser vice provider to the desired user.

A developer extensively uses API’s in his sof tware to implement various features by

using an API call without writing the complex codes for the same. We can create an API

for an operating system, database systems, hardware system, for a JavaScript file or

similar object oriented files. Also, an API is similar to a GUI(Graphical User Inter face)

with one major difference. Unlike GUI’s, an API helps the sof tware developers to access

the web tools while a GUI helps to make a program easier to understand by the users.

Real life example of an API:

Suppose, we are searching for a hotel room on an online website. In this case, you have

a vast number of options to choose from and this may include the hotel location, the

check-in and check-out dates, price, accommodation details and many more factors. So

in order to book the room online, you need to interact with the hotel booking’s website

which in fur ther will let you know if there is a room available on that par ticular date or

We use cookies to ensure you have the best browsing experience on our website. By using
not and at what price.
our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Got It !
Now in the above example, the Policy ▲
API is the inter face that actually communicates in

https://www.geeksforgeeks.org/introduction-to-apis/ 1/6
1/12/2021 Introduction To APIs - GeeksforGeeks

between. It takes the request of the user to the hotel booking’s website and in turn

returns back the most relevant data from the website to the intended user. Thus, we can

see from this example how an API works and it has numerous applications in real life

from switching on mobile phones to maintaining a large amount of databases from any

corner of the world.

There are various kinds of API’s available according to their uses and applications like

the Browser API which is created for the web browsers to abstract and to return the

data from surroundings or the Third par ty API’s, for which we have to get the codes

from other sites on the web(e.g. Facebook, Twitter).

Types of APIs :

There are three basic forms of API-

1. WEB APIs :

A Web API also called as Web Ser vices is an extensively used API over the web and

can be easily accessed using the HT TP protocols. A Web API is an open source

inter face and can be used by a large number of clients through their phones, tablets.

or PC’s.

We use cookies to ensure you have the best browsing experience on our website. By using
our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Got It !
Policy ▲

https://www.geeksforgeeks.org/introduction-to-apis/ 2/6
1/12/2021 Introduction To APIs - GeeksforGeeks

Related Articles

2. LOCAL APIs :

In this types of API, the programmers get the local middleware ser vices. TAPI

(Telephony Application Programming Inter face), .NE T are common examples of

Local API’s.

3. PROGR AM APIs :

It makes a remote program appears to be local by making use of RPC’s (Remote

Procedural Calls). SOAP is a well-known example of this type of API.

Few other types of APIs:

SOAP (SIMPLE OB JECT ACCES S PROTOCOL): It defines messages in XML format

used by web applications to communicate with each other.

REST (Representational State Transfer): It makes use of HT TP to GE T, POST, PUT,

or DELE TE data. It is basically used to take advantage of the existing data.

JSON-RPC: It use JSON for data transfer and is a light-weight remote procedural

call defining few data structure types.

XML-RPC: It is based on XML and uses HT TP for data transfer. This API is widely

used to exchange information between two or more networks.

A bove are the various types and forms of API’s extensively used over web networks to

exchange information and to enhance communication between them.

Advantages of APIs –

Efficiency: API produces efficient, quicker and more reliable results than the

outputs produced by human beings in an organization.

Flexible deliver y of ser vices : API provides fast and flexible deliver y of ser vices
We use cookies to ensure you have the best browsing experience on our website. By using
our according
site, you acknowledge that you haverequirements.
to developers read and understood our Cookie Policy & Privacy Got It !
Policy ▲
Integration: The best feature of API is that it allows movement of data between

https://www.geeksforgeeks.org/introduction-to-apis/ 3/6
1/12/2021 Introduction To APIs - GeeksforGeeks

various sites and thus enhances integrated user experience.

Automation: A s API makes use of robotic computers rather than humans, it produces

better and automated results.

New functionality: While using API the developers find new tools and functionality

for API exchanges.

Disadvantages of APIs –

Cost : Developing and implementing API is costly at times and requires high

maintenance and suppor t from developers.

Security issues : Using API adds another layer of sur face which is then prone to

attacks, and hence the security risk problem is common in API’s.

RECOMMENDED ARTICLES Page : 1 2 3

Exposing ML/DL Models as REST Beginning BootStrap (Part-1) |


01 05
APIs Introduction and Installation
16, Jan 19 11, Jan 16

Introduction to Apache Maven | A


Top 7 Payment Gateway APIs That 06
build automation tool for Java
02
Every Developer Must Know projects
18, Mar 20
17, May 18

GIT | An Introduction to Github Hygienic Macros : An Introduction


07
03 17, Sep 15
08, Apr 17

Introduction To Machine Learning


08
MongoDB : An introduction using Python
04 04, Nov 15 04, May 17

We use cookies to ensure you have the best browsing experience on our website. By using
our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Got It !
Policy ▲
 Like 0

https://www.geeksforgeeks.org/introduction-to-apis/ 4/6
1/12/2021 Introduction To APIs - GeeksforGeeks

 Previous Next 

Ar ticle Contributed By :

AkshitaKumawat
@AkshitaKumawat

Vote for di culty

Current di culty : Medium

Easy Normal Medium Hard Expert

Article Tags : Technical Scripter 2018 , GBlog , Technical Scripter

Improve Article Report Issue

Writing code in comment? Please use ide.geeksforgeeks.org, generate link and share the link here.

Load Comments

We use cookies to ensure you have the best browsing experience on our website. By using
our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Got It !
Policy ▲

https://www.geeksforgeeks.org/introduction-to-apis/ 5/6
1/12/2021 Introduction To APIs - GeeksforGeeks

5th Floor, A-118,


Sector-136, Noida, Uttar Pradesh - 201305
feedback@geeksforgeeks.org

Company Learn
About Us Algorithms
Careers Data Structures
Privacy Policy Languages
Contact Us CS Subjects
Video Tutorials

Practice Contribute
Courses Write an Article
Company-wise Write Interview Experience
Topic-wise Internships
How to begin? Videos

@geeksforgeeks , Some rights reserved

We use cookies to ensure you have the best browsing experience on our website. By using
our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Got It !
Policy ▲

https://www.geeksforgeeks.org/introduction-to-apis/ 6/6

You might also like