Introduction To APIs - GeeksforGeeks
Introduction To APIs - GeeksforGeeks
Introduction To APIs - GeeksforGeeks
Introduction To APIs
Difficulty Level : Medium ● Last Updated : 17 Jan, 2019
What is an API?
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
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
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.
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
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
Types of APIs :
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
Local API’s.
3. PROGR AM APIs :
JSON-RPC: It use JSON for data transfer and is a light-weight remote procedural
XML-RPC: It is based on XML and uses HT TP for data transfer. This API is widely
A bove are the various types and forms of API’s extensively used over web networks to
Advantages of APIs –
Efficiency: API produces efficient, quicker and more reliable results than the
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
Automation: A s API makes use of robotic computers rather than humans, it produces
New functionality: While using API the developers find new tools and functionality
Disadvantages of APIs –
Cost : Developing and implementing API is costly at times and requires high
Security issues : Using API adds another layer of sur face which is then prone to
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
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
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
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