# API Testing

> Testing an API on its own. You send requests and check the answers.

**Field:** Software Development  
**Category:** APIs  
**Also known as:** API Test, API Tests, Backend Testing

## Think of it like

Think of it like testing a snack machine from the back. You check the parts work before anyone sees the front.

## Definition

API testing checks an API directly, with no screen in between. A test sends a request and checks the answer. It looks at the status code, the body and how long it took. It also tries bad input to see that errors come back right. These tests are faster and steadier than tests that click through a browser.

## Example

Lucy's API tests send 50 requests to her orders API on every push. One test checks a missing order returns 404.

## Why it matters

Most app logic sits behind the API. Testing it there catches bugs early and fast.

## Common mistake

Checking only that the status is 200. Check the body too, or wrong data slips through.

## Three principles

- **No screen.** Talk to the API directly.
- **Check everything.** Status, body and speed.
- **Try bad input.** Errors must come back right.

## Related terms

- [Application Programming Interface (API)](https://learn.benibix.com/term/development/api)
- [Integration Test](https://learn.benibix.com/term/development/integration-test)
- [Postman](https://learn.benibix.com/term/development/postman)
- [Contract Testing](https://learn.benibix.com/term/development/contract-testing)
- [Mock Server](https://learn.benibix.com/term/development/mock-server)

![Two panels. API testing: a test sends a request straight to the API, with no screen, and checks the status code, the body and the speed. Contract testing and mock servers, lit up: a frontend team tests against a mock server that copies the API, while the backend team is still building it. A shared contract file sits between them, and both sides are tested against it.](https://learn.benibix.com/diagrams/dev3-api-testing.svg)

---

Source: https://learn.benibix.com/term/development/api-testing
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
