Test REST and SOAP APIs Online
API Test Lab is a lightweight API client that runs in your browser. Build a request with a method, URL, query parameters, headers, body and authentication, send it, and read the status code, timing, headers and formatted response. Requests go directly from your browser to the API, not through our server.
Paste a cURL command into the URL box and it is turned into a request for you. When you are done, copy the request back out as cURL or JavaScript fetch code.
Key features
- GET, POST, PUT, PATCH, DELETE, HEAD and OPTIONS requests
- Query parameters and headers in editable tables with on and off switches
- JSON, form (urlencoded), XML and text bodies, with a JSON validator and prettifier
- No auth, Bearer token, Basic auth and API key (header or query)
- Variables such as {{baseUrl}} and {{token}} for URLs, headers, bodies and auth
- Import from cURL, export as cURL or fetch
- Formatted JSON responses with status, time, size, redirects and headers
- Requests go straight from your browser, so you can test APIs on localhost too
- Recent request history
Import a cURL command
curl -X POST 'https://jsonplaceholder.typicode.com/posts' \
-H 'Content-Type: application/json' \
-d '{"title":"Hello","userId":1}'
How to use
- Pick a method and enter the URL, or paste a cURL command.
- Add parameters, headers, a body or authentication in the tabs.
- Click Send, or press Ctrl or Cmd with Enter, then read the response.
- Copy the request as cURL or fetch code when you need it elsewhere.
Use cases
- Debugging a REST endpoint while building a frontend
- Checking status codes, headers and response bodies of a third-party API
- Reproducing a cURL command from documentation or a bug report
- Testing a SOAP service by sending an XML body with a POST request
In depth
An HTTP request has four parts that matter when debugging: the method, the URL with its query string, the headers and the optional body. The method signals intent. GET and HEAD should be safe and have no side effects, PUT and DELETE are meant to be idempotent, while POST and PATCH usually are not. Sending the same POST twice may create two records, so check before retrying.
Because requests leave your browser directly, the browser enforces CORS. If an API does not return the right Access-Control-Allow-Origin header, the browser may block you from reading the response even though the server received the request. Some headers, such as Host and Cookie, are also controlled by the browser and cannot be set freely. A failure with no status code usually points to CORS, a network error or a mixed-content block rather than a server error.
Tips
- Set the Content-Type header to match the body you send, for example application/json for JSON. A mismatch is a very common reason an API answers 400 or 415 even though the payload looks correct.
- Keep base URLs and tokens in variables such as baseUrl and token. Switching from staging to production then means changing one value, and you avoid pasting a live token into many headers.
- Do not share exported cURL or fetch snippets without checking them first. They contain whatever Authorization header or API key you configured, which anyone holding the snippet could reuse.