TL;DR
What it does: Free HTTP debugging tool that shows exactly what your HTTP client sends. Test GET, POST, PUT, DELETE, status codes, delays, redirects, and authentication through simple URLs.
Quick start: https://httpbin.org/get
No API key needed - just call the URL
Overview
HTTPBin is a free HTTP request and response debugging service that lets you see exactly what your HTTP client is sending. When you make a request to any HTTPBin endpoint, it reflects back information about your request including headers, IP address, query parameters, form data, and JSON payloads. It supports all common HTTP methods and includes endpoints for testing status codes, response delays, redirects, authentication, and more. No API key or registration required.
Live Example
Here's the exact URL to call and the real response you'll get:
The actual response you get:
{
"args": {},
"headers": {
"Accept": "*/*",
"Host": "httpbin.org",
"User-Agent": "curl/8.9.1",
"X-Amzn-Trace-Id": "Root=1-..."
},
"origin": "203.0.113.1",
"url": "https://httpbin.org/get"
}
What does this data mean?
HTTPBin returns everything about the request you made. Here is what each field in the response tells you:
- args
- Query parameters you included in the URL. For
?foo=bar&baz=123you get{"foo": "bar", "baz": "123"}. Empty object means no query params were sent. - headers
- All the HTTP headers your client sent with the request, including User-Agent, Host, Accept, cookies, and custom headers.
- origin
- Your IP address as seen by the server. Useful for checking what your outgoing IP looks like.
- url
- The exact full URL you requested, including any query parameters.
- method
- HTTP method used (GET, POST, PUT, DELETE, PATCH, etc.). Only appears on the
/anythingendpoint. - data
- Raw request body content (for non-JSON payloads like plain text or XML).
- form
- Form data submitted with
application/x-www-form-urlencodedormultipart/form-datacontent types. - files
- Any files uploaded in the request, returned as filename-content pairs.
- json
- Parsed JSON body when you send with
Content-Type: application/json. Returnsnullif no JSON was sent.
How to use this API
JavaScript Example
// Test a GET request with query parameters
fetch('https://httpbin.org/get?foo=bar&baz=123')
.then(res => res.json())
.then(data => {
console.log('Your IP:', data.origin);
console.log('Query params:', data.args);
console.log('Headers:', data.headers);
});
// Test a POST request with a JSON payload
const payload = { name: 'test', value: 123 };
fetch('https://httpbin.org/post', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(payload)
})
.then(res => res.json())
.then(data => console.log('You posted:', data.json));
// Test a delayed response (2 second delay)
fetch('https://httpbin.org/delay/2')
.then(res => res.json())
.then(data => console.log('Response after 2s:', data));
Python Example
import requests
# Test a GET request with query parameters
r = requests.get('https://httpbin.org/get', params={'foo': 'bar'})
data = r.json()
print(f"Your IP: {data['origin']}")
print(f"Query params: {data['args']}")
# Test a POST request with a JSON payload
payload = {'name': 'test', 'value': 123}
r = requests.post('https://httpbin.org/post', json=payload)
data = r.json()
print(f"You posted: {data['json']}")
# Test a delayed response (3 second delay)
r = requests.get('https://httpbin.org/delay/3')
data = r.json()
print(f"Response after 3s, URL: {data['url']}")
Frequently Asked Questions
- Do I need an API key?
- No! HTTPBin is completely free and open with no authentication required. Just call any endpoint URL.
- Is there a rate limit?
- None documented. HTTPBin appears to have no restrictions on usage, though reasonable use is encouraged.
- What HTTP methods can I test?
- All of them. Use
/get,/post,/put,/patch,/delete- each returns details about the corresponding HTTP method. - How do I test a POST request?
- Send your POST data to
https://httpbin.org/post. Thejsonfield in the response will contain your parsed JSON body,formwill contain form-encoded data, andfileswill contain uploaded files. - How do I test response delays?
- Use
/delay/{n}where{n}is the number of seconds to wait. For example,https://httpbin.org/delay/3waits 3 seconds before responding. - How do I test status codes?
- Use
/status/{code}likehttps://httpbin.org/status/404for a 404 response, or/status/500for a 500 error. - How do I test redirects?
- Use
/redirect/{n}for{n}consecutive redirects, or/redirect-to?url=...to redirect to a specific URL. - Can I test authentication?
- Yes! Use
/basic-auth/{user}/{passwd}for Basic Auth,/bearerfor Bearer token auth, or/digest-auth/{qop}/{user}/{passwd}for Digest Auth. - Can I test custom headers?
- Yes. Send any custom headers you like and HTTPBin will echo them back in the
headersfield of the response. - Can I use this commercially?
- Yes, HTTPBin is open source (MIT license) and free for both personal and commercial use. Check the official documentation for any specific restrictions.
- How do I parse the JSON response?
- In JavaScript:
data.origin,data.headers. In Python:data['origin'],data['headers']. The field explanations above show what each field contains.
API Details
- Base URL
https://httpbin.org- Documentation
- https://httpbin.org/
- Category
- Developer Tools
- Authentication
- None required - completely free
- Rate Limit
- None documented
- Geographic Coverage
- Global