API Request Tester

Send a GET, POST, PUT, PATCH or DELETE request with your own headers and body, and see the status code, response time, headers and body. Requests go straight from your browser, so the API has to allow cross-origin (CORS) requests.

Tip: use test tokens rather than production credentials.

How to use the API request tester

  1. Pick the method (GET, POST, PUT, PATCH or DELETE) and enter the full URL, including https://.
  2. Add headers as a JSON object, for example {"Authorization": "Bearer ...", "Content-Type": "application/json"}.
  3. For POST, PUT and PATCH, type the request body. It is sent exactly as written, so set Content-Type yourself.
  4. Press Send. The status, response time, headers and body appear underneath, with JSON responses formatted.

The request goes directly from your browser to the API you enter. It does not pass through our servers. The last URL and method are remembered in this browser only, to save typing; headers and bodies are not.

Why some requests fail: CORS

Because the request is made by your browser from this website, the browser applies the same rules it applies to any web page. An API only answers a page on another website if it sends CORS headers, such as Access-Control-Allow-Origin, that allow it. Many public APIs do. Many private and internal APIs do not.

When an API does not allow it, the browser blocks the response and the tool can only show a network error such as "Failed to fetch". The request may still have reached the server. To test those APIs, use curl, a desktop client or a script, which are not subject to CORS.

Two related limits: the browser only lets the page read response headers that the API exposes with Access-Control-Expose-Headers, and cookies for the API's site are not sent, so test cookie-based logins elsewhere and use an Authorization header here.

The same request in curl

If you need to repeat a request outside the browser, the equivalent curl command for a JSON POST looks like this.

Shell
curl -X POST "https://api.example.com/users" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"name": "Ada"}'

Reading the response

Status codes in the 200s mean success, 300s are redirects (which the browser follows for you), 400s mean the request was wrong (401 not authenticated, 403 not allowed, 404 not found, 422 failed validation) and 500s mean the server failed. The time shown is measured in your browser, so it includes the network round trip as well as the server's work.

When you would use it

  • Checking a public API's response format before writing code against it.
  • Confirming that your own API's CORS settings allow a browser client to call it.
  • Reproducing a bug report with a specific request body and headers.

Frequently asked questions

Why do I get "Failed to fetch"?

Usually the API does not allow cross-origin requests (CORS), the URL is http rather than https (browsers block insecure requests from secure pages), or the address is wrong. The browser console shows which one.

Can I call an API on localhost?

Browsers increasingly block or ask permission for requests from a public website to your own machine. For local development a command line tool such as curl, or a desktop client, is more reliable.

Is it safe to put an API token in the headers?

The token is only sent to the URL you enter, straight from your browser, and is not saved. Still, prefer test or short-lived tokens over production keys in any tool, and revoke a token you have pasted somewhere you did not intend.

Does it support form data or file uploads?

No. The body is sent as text, which covers JSON, XML and URL-encoded forms if you set the matching Content-Type. Multipart file uploads need a different client.

Related tools and guides

Requests are sent from your browser straight to the URL you enter. They do not pass through our servers.

Building something bigger?

We design and build web and mobile applications and the APIs behind them.