> For the complete documentation index, see [llms.txt](https://splootcode.gitbook.io/api-scheduled-apps/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://splootcode.gitbook.io/api-scheduled-apps/application-programming-interfaces-apis/what-apis-look-like/api-requests.md).

# API requests

An API request is a way for one software application to communicate with another software application to access or exchange data or functionality.

To make an API request, a `client application` sends a request to the receiving application (referred to as `server application`) using a specific URL, which includes:

* A request method – such as **GET**, **POST**, **PUT**, **DELETE**
* Any necessary parameters or data

The `server application` then processes the request and sends a response back to the `client application`, usually in the form of structured data – in formats such as JSON or XML.

### APIs are widely used

API requests can be used for a wide range of purposes, including retrieving data from a remote server, submitting data to a remote server for processing, updating data on a remote server, and triggering specific actions or events on a remote server.&#x20;

API requests are widely used in web and mobile application development, as well as in the integration of various software systems.&#x20;

In fact, every time you visit a website you are effectively sending a request!

### Example

Let's say you are really into cats, and you want to get a new cat-related fact every day.&#x20;

Well, there's an API for that! Specifically, the [catfact.ninja](https://catfact.ninja/) API.&#x20;

And with [this short SplootCode program](https://app.splootcode.io/shared/mattia/cat-facts/TcHLGlkXXmoYmAs_dQ_9FAKR) you can easily access it and get all the cat facts you want, right in SplootCode.

<figure><img src="https://3001335031-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSF2vYmKtkpTPTFnIRF09%2Fuploads%2FGHJ8UyIeVlED0sF5DS70%2Fimage.png?alt=media&amp;token=87d7f209-c50f-4007-b694-9d7de64d8079" alt=""><figcaption></figcaption></figure>

So what the program above is doing is sending a request to the catfact.ninja API, and the catfact.ninja API is sending back a response.

SplootCode is then grabbing this response – that comes in formatted as a JSON file (don't worry about this for now) – and transforming it into normal text.

<details>

<summary>Here's what the raw JSON file looks like</summary>

```json
{
"fact": "Tigers are excellent swimer and do not avoid water",
"length": 41
}
```

</details>

This response contains more data as well – that is the length of the fact.&#x20;

To learn more about what this means (and why it's cool) read on to [API responses](/api-scheduled-apps/application-programming-interfaces-apis/what-apis-look-like/api-responses.md) to learn more.
