> For the complete documentation index, see [llms.txt](https://www.pranaypourkar.co.in/the-programmers-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.pranaypourkar.co.in/the-programmers-guide/api/api-basics/consumers-and-providers.md).

# Consumers & Providers

## About

Understanding the distinction between **API Consumers** and **API Providers** is essential to working with APIs. APIs are built around the concept of communication between systems—**one side offers a service**, and **the other side uses it**.

## What is an API Provider ?

An **API Provider** is the system or organization that **creates and exposes the API**. It is responsible for:

* **Defining the interface** (what endpoints exist, what parameters they accept, what responses are returned)
* **Hosting the API** (making it accessible over the internet or within an internal network)
* **Implementing business logic** that runs behind the API
* **Securing the API** to ensure only authorized access
* **Maintaining documentation** for others to understand and use the API

#### Examples of API Providers

* Stripe provides payment APIs.
* Twitter provides APIs to post tweets or fetch user data.
* Our own backend service, when exposing REST endpoints to our frontend app.

## What is an API Consumer ?

An **API Consumer** is the **system, application, or developer that uses the API** to access the functionality or data it provides. It **makes requests** to the API endpoints, following the defined contract.

The consumer doesn't need to know how the provider processes the request internally—it only needs to understand how to call the API and handle the response.

#### What Consumers Do

* Construct HTTP requests (with correct method, headers, parameters)
* Parse and use the response data
* Handle errors, retries, and failures
* Follow authentication procedures (like using API keys, tokens)

#### Examples of API Consumers

* A mobile app fetching user data from a backend service.
* A frontend React app calling an internal inventory API.
* A third-party developer integrating Google Maps into their website.

## Example

Let’s say we have an **e-commerce platform**

* The **backend** team builds and publishes APIs for products, orders, and payments → they are the **API providers**.
* The **frontend** team builds a React or Android app that consumes those APIs to show products or place orders → they are the **API consumers**.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://www.pranaypourkar.co.in/the-programmers-guide/api/api-basics/consumers-and-providers.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
