The Wayback Machine - https://web.archive.org/web/20261201070825/https://www.geeksforgeeks.org/software-testing/what-is-an-api/

Introduction to API (Application Programming Interface)

Last Updated : 25 Nov, 2026

An API (Application Programming Interface) is a set of rules that enables software components to communicate and access each other's data or functionality.

  • Hides internal implementation details from the client.
  • Allows developers to reuse existing services and functionality.
  • Enables integration between applications built using different technologies.

Example: A weather application uses a Weather API to retrieve and display temperature and weather conditions for a location.

API Working

A web API follows a request-response model in which a client communicates with a server through an API endpoint.

frame_3258
API Working Process
  • The client sends an HTTP request to an API endpoint with the required parameters, headers or request body.
  • The server validates the request and identifies the requested operation.
  • The application logic processes the request and interacts with databases or external services if required.
  • The server returns a response containing an HTTP status code and, when applicable, data in a format such as JSON or XML.

API Design Approaches

Different architectural styles, protocols and frameworks are used to design APIs.

Types of APIs

Based on accessibility, APIs are classified into three common categories:

  • Public APIs: Available to external developers under defined access policies.
  • Private APIs: Restricted to internal applications within an organization.
  • Partner APIs: Accessible only to authorized business partners.

APIs can also be composite APIs, which combine multiple operations into a single request to reduce the number of client-server interactions.

API Integration

API integration connects applications to exchange data and automate operations. Common examples include:

  • Payment APIs process online transactions.
  • Maps APIs provide location and navigation services.
  • Authentication APIs verify user identities.
  • CRM APIs synchronize customer information.

API Restrictions

API providers can enforce restrictions to maintain security, reliability, and controlled resource usage.

  • Rate limits restrict the number of requests within a specific time interval.
  • Authentication verifies the identity of clients.
  • Authorization controls access to resources and operations.
  • Usage quotas limit total resource consumption within a defined period.
  • Version policies restrict access to supported API versions.

API Vs UI

An API and a UI (User Interface) both provide ways to interact with a software system, but they serve different purposes. A UI is designed for users to interact with an application, while an API is designed for applications to communicate with other applications or services.

FeatureAPIUI
PurposeEnables communication between software systemsEnables interaction between users and software
Used ByApplications and developersEnd users
InteractionRequests and responsesButtons, forms, menus, screens, etc.
VisibilityUsually works behind the scenesDirectly visible to users
ExamplePayment API, Weather APICheckout page, Weather app screen

Advantages of APIs

  • Reduce development effort through reusable functionality.
  • Support integration between different technologies.
  • Enable independent development and maintenance of software components.

Limitations of APIs

  • Poor security can expose sensitive data.
  • Network latency can affect remote API performance.
  • API changes can introduce compatibility issues.
  • Third-party service failures can disrupt dependent applications.

Related Article: API Testing.

Comment

Explore