Introduction to API and Its Role in
Web Development
ICT Lecture
Application Programming
Interface (API)
• Why are APIs important in Web
Development?
• APIs enable communication between different
services.
• They allow developers to integrate external
systems and data into their apps without
building everything from scratch.
• Examples of apps using APIs: Foodpanda,
InDrive, Bykea.
• APIs facilitate everything from payment
gateways to location tracking.
How Foodpanda Tracks Your
Delivery
• Example of Foodpanda:
• Foodpanda uses Google Maps API to track the delivery.
• Google Maps provides location data, but Foodpanda cannot
access it directly for security reasons.
• Foodpanda requests the data through an API to track the
delivery person in real-time.
What Is an API?
• API as a messenger:
• An API acts as a middleman that sends data
from one system to another.
• Example: Foodpanda requests information from
Google Maps via API to track the delivery.
• How it works:
• Foodpanda asks for data from the API (like
delivery location).
• The API checks with Google Maps if the data
can be shared.
• If yes, the data is shared; if no, the request is
denied.
Data Requests and Security
• Security in API:
• Direct access to databases or systems is not allowed for third-party apps.
• Instead, APIs ensure secure data access by filtering and validating requests.
• Example: Apps asking Google or Facebook to verify users for registration.
• API Key:
• Each developer is given a security key (API Key) to access an API securely.
• APIs monitor and ensure no illegal activities or abuse.
API Key
Both security and monitoring is provided via API
so randomly everyone can no t access as activities
are monitored via API keys
Advantages of Using APIs
• 1. Security:
• APIs prevent unauthorized access to systems, ensuring data safety.
• Example: Foodpanda cannot access Google Maps data directly, keeping the
system secure.
• 2. Monitoring:
• APIs help monitor and limit requests to prevent misuse.
• No unlimited requests or illegal activities can be performed via APIs.
• So the API Not HOW, For example if there is system has a recipe of a
burger then API will not give recipe(source-code) it will only share
features of end product.
Using APIs in Your Projects
• How APIs are useful in projects:
• When developing an app or website,
use APIs to avoid building everything
from scratch.
• Example: If you want to get weather
data, use a weather API instead of
calculating temperatures manually.
• APIs provide easy access to data that
can be integrated into your project.
• Example of a project: Integration of
weather APIs or currency conversion
APIs for a travel app.
Real-life API Use Case
• Example of Ticket Booking with APIs:
• When you book tickets for a movie or a concert, the platform uses APIs to
access live ticket availability.
• Payment gateways also use APIs to securely process payments via services
like JazzCash or debit cards.
• APIs help fetch live data such as seat availability, prices, and secure
transactions.
Creative Project Ideas Using
APIs
• Create projects using APIs:
• Automated notifications for real-time ticket booking updates or live sports
scores.
• Build unique applications by integrating third-party data.
• Example: Using weather APIs for forecasting or integrating Google Maps API
for location-based apps.
Conclusion and Next Steps
• APIs are essential for modern web development.
• They allow developers to access third-party data securely and
efficiently.
• Explore and use APIs to create innovative projects!