What is an API and it's advantages and make a pdf
shiva951908
0 views
13 slides
Oct 31, 2025
Slide 1 of 13
1
2
3
4
5
6
7
8
9
10
11
12
13
About This Presentation
Remove last 2 pages from slide and add thank you page
Size: 1.91 MB
Language: en
Added: Oct 31, 2025
Slides: 13 pages
Slide Content
What is an API?
The Building Blocks of Modern Software
What is an API? (The Analogy)
|; = Think of it as a waiter.
f > You (the application) tell the waiter (API) what you want.
» + —o—,
The waiter goes to the kitchen (server/database) to get it.
m Finally, the waiter brings the food (data) back to you.
==
.
How APIs Work (The 3-Step Process)
a
1. Request
Your application asks for data or
to perform an action.
dy
2. Processing
The API receives the request and
processes it (e.g. gets data from
a database).
[a]
3. Response
The API sends back the result
(the data or a confirmation) to
your application.
Types of APIs (Web APIs)
pas
REST
Representational State Transfer.
The most common type, uses
standard HTTP methods. Flexible
and lightweight.
SOAP
Simple Object Access Protocol
XML-based, very structured and
secure. Often used in enterprise
systems.
Q
GraphQL
‘A query language for APIs. Lets
the client ask for exactly what it
needs and nothing more.
Types of APIs (Other Categories)
Library/Framework APIs: Used to interact with a software library. (e.g.. The Python ‘requests
y y (eg. vf is)
library, Java API).
@ Operating System APIs: Allows applications to interact with the computers OS (e.g. Windows
API, POSIX for Linux/macOS)
Database APIs: Provides a standard way to connect and run queries on a database (e.g., JDBC,
y 9.
ODBC).
Focus: REST API Basics (HTTP Verbs)
O
GET
Retrieve data from the server.
POST
Create new data on the server.
O
O
PUT
Update existing data on the server.
DELETE
Remove data from the server.
O
Using a Weather App
1 App sends a GET request to a weather API
2. The API fetches the latest data from its weather database.
3. The API returns the data (as JSON) like temperature and
humidity.
4. The App displays the information to you in a friendly way.
Common Response Format: JSON
What is JSON?
Stands for JavaScript Object Notation
Its a lightweight, human-readable format for exchanging
data
It's the most common format used by modern REST APIs.
{ "user
"B.Tech CSE" )
"John",
"age": 20,
"course":
Why Do APIs Matter?
Sy #
Interoperability Efficiency
Enable different Allow developers to
systems to work use existing services
together and share (Google Maps,
data Payments)
Scalability
Support mobile apps,
web apps, and loT
devices from one
backend,
&
Architecture
Enable modern
microservices, where
‘apps are built of
small, connected
services.
Simple Example in Python
Making an API Call
# Import the library import requests # Making the
API call response =
This example uses the popular * requests” library in Python. requests.get('https://api.example.com/users') # Get
data from the JSON response data = response. json()
a ie # Print the data print(data)
It makes a ‘GET’ request to a placeholder API A
It then parses the JSON response and prints the data.
The Big Picture
APIs are fundamental to modern software
development, making it possible to build
complex applications by connecting various
services together!