API Tester

The Complete API Tester Guide

How to build an HTTP request, read the response, and understand why CORS blocks some requests when calling an API straight from the browser.

Open API Tester

Building a Request

Every HTTP request starts with a method (GET to read data, POST to create, PUT/PATCH to update, DELETE to remove) and a URL. From there you can attach optional pieces: Headers carry metadata like authentication tokens or content type, Params are key/value pairs appended to the URL's query string (this tool appends them live as you type), and the Body carries the actual data you're sending - typically JSON for a modern REST API.

The Format JSON button in the Body tab runs your text through JSON.stringify(JSON.parse(text), null, 2), which both validates the JSON and pretty-prints it with 2-space indentation - if the JSON is malformed, you get a specific parse error instead of a silent failure.

Reading the Response

FieldWhat it tells you
Status codeA 3-digit code from the server - 2xx means success, 4xx means a client-side problem (like a bad request or missing auth), 5xx means a server-side problem
Response headersMetadata the server sent back, such as content-type, caching rules, or rate-limit info
Response bodyThe actual payload - pretty-printed automatically if it's valid JSON, shown raw otherwise
DurationTotal round-trip time in milliseconds, measured with performance.now() before and after the request

Status codes in the 200-299 range are shown in green; 400 and above are shown in red, so you can spot a failing request at a glance before reading the details.

CORS Explained - Why Some Requests Get Blocked

This tool has no backend - every request goes straight from your browser to the target URL via fetch(), exactly like a real web app calling that API. Browsers enforce CORS (Cross-Origin Resource Sharing) on every cross-origin request: unless the target server explicitly responds with an Access-Control-Allow-Origin header permitting this page's origin, the browser blocks JavaScript from reading the response, even if the server processed the request successfully.

That's why this tool honestly distinguishes two very different failure modes: a real HTTP error (the request reached the server, which responded with a 4xx/5xx status) versus a network/CORS failure (the browser never let the response through, or the request couldn't reach the server at all). If you're testing your own API and hitting CORS blocks, the fix lives on the server - add the appropriate CORS headers there, it's not something a client tool can work around.

Common Use Cases

Quick API ExplorationPoke at a new public API's endpoints without writing any code or installing a client.
Debugging Your Own BackendConfirm your server returns the status, headers, and JSON shape your frontend expects.
Spot-Checking LatencyGet a rough sense of an endpoint's response time from your own network.

Frequently Asked Questions

What's the difference between PUT and PATCH?

PUT is defined to replace the entire resource with whatever you send - any field you omit is conceptually treated as removed. PATCH is defined to apply a partial update, changing only the fields included in the request body. In practice many APIs treat PUT more like a partial update too, so it's always worth checking that specific API's documentation rather than assuming the spec definition holds.

What actually happens during a CORS preflight request?

For a "non-simple" request - typically anything using PUT, PATCH, or DELETE, or a POST with a JSON body plus custom headers - the browser automatically sends an OPTIONS request to the target URL before your real request, asking which origins, methods, and headers the server allows. Only if the server's response approves them does the browser send the actual request. This tool doesn't build that OPTIONS request itself; fetch() and the browser handle it silently underneath every call this tool makes.

What's the difference between an API key and a Bearer token?

An API key is usually a single long-lived secret that identifies an application or account, and it's often passed as a query parameter or a custom header. A Bearer token - commonly issued by an OAuth flow - represents a specific authenticated session or user, is normally shorter-lived, and is sent in the Authorization: Bearer <token> header. Both are just header or param values from this tool's point of view - add whichever one the API you're testing expects.

Why do most modern REST APIs use JSON instead of XML?

JSON maps directly onto the data structures most languages already have (objects, arrays, strings, numbers), is far less verbose than XML's opening/closing tags, and needs no separate schema to parse with JSON.parse(). XML is still common in older enterprise and SOAP-based systems, and remains better suited to documents that mix markup with data, but for typical request/response API payloads JSON has become the default.

What does it mean for an HTTP method to be idempotent?

An idempotent method produces the same end state no matter how many times you repeat the identical request. GET, PUT, and DELETE are idempotent - sending the same PUT twice leaves the resource exactly as it was after the first call. POST is not idempotent by default - calling it twice can create two separate resources, which is why retry logic treats POST much more cautiously than GET or PUT.

What's the difference between a 401 and a 403 response?

401 Unauthorized means the server doesn't know who you are - your credentials are missing, expired, or invalid. 403 Forbidden means the server does know who you are but has decided you don't have permission for that specific action. Mixing the two up is one of the most common mistakes in API design, so it's worth checking both when a request you expect to work gets rejected.

Open API Tester