Fewv Minutes of What are APIs?

» What is an API?

What is an API

  1. An API, or Application Programming Interface, is a set of protocols and rules, for building software applications.

  2. APIs specify how software components should interact, allowing different software applications to communicate with each other.

  3. In simpler terms, an API acts as a messenger between different software applications, allowing them to share data and functionality with each other in a standardized and secure way.

  4. This enables developers to build new applications or features on top of existing software infrastructure, without having to start from scratch each time.

  5. APIs acts as an intermediary layer that processes data transfers between systems, letting companies open their application data and functionality to external third-party developers, business partners, and internal departments within their companies.

» What does ‘Application’, ‘Programming, ‘Interface’ mean in API?

What is an API gif

  1. Application: In context of API, Application refers to any software with a distinct function.

  2. Programming: Programming means writing out code, in the context of API, programming refers to the act of writing code that uses the API to access the functionality provided by a software system. Developers use programming languages such as Java, Python, or JavaScript to write code that interacts with the API by making requests, sending data, and receiving responses.

  3. Interface: In the context of API, an interface refers to a set of rules and protocols that define how software components should communicate with each other. Like you see buttons on Social Media, that’s an API.

» Day to Day Examples of APIs.

Example of API gif

  1. Let’s understand it with example like social media login.

  2. When you want to login to your Instagram account you can see something like Username and Password then after you fill it, you can log into your Instagram account or you can even log in with the help of Facebook.

  3. This login with Facebook is an API.

  4. When you click on login with Facebook it sends a request to that Facebook server and ask for your Facebook credentials like your username and your password.

OR

  1. Let’s say you want to build a new social media platform, but you don’t want to build all of the features from scratch.

  2. You could use APIs provided by existing social media platforms, such as Facebook or Twitter, to integrate their data and functionality into your platform.

  3. For example, you could use the Facebook Graph API to allow your users to sign up for your platform using their Facebook credentials.

  4. This would simplify the registration process for your users and also give you access to some of their Facebook data, such as their name, profile picture, and friend list, which you could use to personalize their experience on your platform.

» How do APIs work?

How do API work gif

  1. API architecture is usually explained in terms of client and server. The application sending the request is called the client, and the application sending the response is called the server.

  2. APIs work by exposing specific functionalities or resources of an application to other applications, which can then access them through a set of defined protocols. These functionalities can range from simple tasks like retrieving data, to more complex tasks like updating, deleting, or creating new data.

  3. To use an API, a developer must first send a request to the API. This request includes information about the desired action, such as the specific resource or data that the developer wants to access.

  4. The API then processes the request and sends back a response, which includes the requested data or information.

» Different ways that APIs can work

API protocol gif

There are many different ways that APIs can work depending on when and why they were created. Common are:

  1. REST APIs: Also called Representational State Transfer. These are the most popular and flexible APIs found on the web today. This type of API uses HTTP requests to access and manage resources, and typically returns data in JSON or XML format.

  2. SOAP APIs: These APIs use Simple Object Access Protocol. Client and server exchange messages using XML. This is a less flexible API that was more popular in the past.

  3. Websocket APIs: Websocket API is another modern web API development that uses JSON objects to pass data. WebSockets are a type of API that enables real-time, bidirectional communication between a client and a server. The server can send callback messages to connected clients, making it more efficient than REST API.

  4. OpenAPI (formerly Swagger) API: OpenAPI is a specification for building APIs, which includes a set of rules for defining the API’s endpoints, parameters, and responses.

  5. GraphQL API: GraphQL is a query language for APIs that enables clients to request the exact data they need, and nothing more.

These are just some of the most common types of APIs, and there are many others as well.

» Different types of APIs based on their scope?

Types of API gif

APIs are classified both according to their architecture and scope of use.

Private, public, composite, and open APIs are different types of APIs that vary in terms of their accessibility, usage, and purpose.

  1. Private API: A private API is an API that is designed for use within a specific organization or company, and is not publicly available for external use. Private APIs are often used to enable communication and data sharing between different internal systems and applications.

  2. Public API: A public API is an API that is available for use by anyone, typically over the internet. Public APIs are often used by developers to build third-party applications that can interact with a specific software or service.

  3. Composite API: A composite API is an API that combines data from multiple sources and provides a unified interface for accessing and interacting with that data. Composite APIs are often used to simplify the process of integrating data from multiple sources into a single application. These combine two or more different APIs to address complex system requirements or behaviors.

  4. Partner API: is a type of API that is designed specifically for partners and affiliates of a company or organization. A partner API allows authorized third-party developers to access certain data and functionality within a company’s software or service, typically for the purpose of integrating that software or service with the partner’s own products or services.

Partner APIs can be private or public, depending on the specific company and the type of data or functionality being exposed. For example, a company may offer a private partner API to a select group of partners who have signed a partnership agreement and meet certain criteria, while also offering a public API for more general use.

Some APIs can fall into multiple categories. For example, an API can be both public and composite, or both private and composite. Additionally, some APIs may have restrictions on usage or may require authentication for access, even if they are considered public or open.


I hope this cleared - What is API? and how do they work. Thank You!!😊