---
title: What is an API?
slug: what-is-an-api
type: explanation
plugin: huxx-connect
summary: A plain-language introduction to APIs, requests, responses, endpoints, and JSON — the four ideas behind everything HuxxConnect does.
keywords: [api, basics, json, endpoint, request, response]
version_added: 1.2.5
version_updated: 1.2.5
level: beginner
related: [how-huxxconnect-works, glossary, your-first-api-connection]
---

Somewhere on the internet, another service has data your site wants: products, weather, prices, tasks, scores. An API (Application Programming Interface) is how that service hands its data to software like your WordPress site — no browser, no copy-paste, no human in the middle. This page explains the four ideas you need: request, response, endpoint, and JSON.

## The vending machine

Think of an API as a vending machine. The machine holds many items, but you can't reach in and grab one. Instead, you press a specific code — B4 — and the machine drops exactly that item. Press a code the machine doesn't have, and you get nothing back but an error light.

APIs work the same way. Your site asks using an exact, agreed-upon address, and the service returns exactly what that address is for. There is no browsing and no ambiguity — which is what makes it dependable enough for a website to use automatically.

## Requests and responses

Every API conversation is one round trip. Your site sends a **request** — "give me the products list" — and the service sends back a **response** containing the data. That's the whole pattern; everything else is detail layered on top.

```mermaid
sequenceDiagram
    participant WP as Your WordPress site
    participant API as DummyJSON API
    WP->>API: Request — GET https://dummyjson.com/products
    API-->>WP: Response — JSON list of products
```

A request names the address it wants and *how* it wants to interact: `GET` means "read data," while `POST` usually means "create or change something." Most of what you'll do with HuxxConnect starts with GET requests.

## Endpoints

The vending machine's B4 has a real name: an **endpoint**. An endpoint is one specific address within an API that returns one kind of data.

The API is the machine; the endpoints are its codes. For example, the free demo service DummyJSON is one API with many endpoints:

- `https://dummyjson.com/products` — the product list
- `https://dummyjson.com/products/1` — one product, by ID
- `https://dummyjson.com/users` — the user list

The part before the path (`https://dummyjson.com`) is called the base URL. In HuxxConnect you save the base URL once as the API, then add each path you need as an endpoint.

## JSON: the shape of the answer

Responses almost always arrive as **JSON** — plain text organized into labeled values and lists, made to be read by software. Here is a trimmed response from `https://dummyjson.com/products`:

```json
{
  "products": [
    {
      "id": 1,
      "title": "Essence Mascara Lash Princess",
      "price": 9.99
    }
  ],
  "total": 194,
  "skip": 0,
  "limit": 30
}
```

Reading it takes two rules. Curly braces `{ }` hold labeled values (`"price": 9.99`), and square brackets `[ ]` hold lists — here, `products` is a list of product objects. Notice that the list lives *inside* a wrapper labeled `products`; many APIs wrap their lists like this, and HuxxConnect lets you point at the wrapper so you get the list itself.

You never have to parse JSON by hand. HuxxConnect turns the response into data you can display with a shortcode or a PHP function, and lets you pluck out single values like that `title`.

## See it in practice

- [Your First API Connection](/docs/connect/tutorial/your-first-api-connection/) — connect your site to DummyJSON and display live data, step by step.
- [How HuxxConnect Works](/docs/connect/explanation/how-huxxconnect-works/) — how these ideas map onto the plugin's screens and features.
