httpbin.org
httpbin · Developer Tools
A simple HTTP Request & Response Service. Run locally: $ docker run -p 80:80 kennethreitz/httpbin
Authentication
Sample Requests
Drips data over a duration after an optional initial delay.
Hover any highlighted part to learn what it does
curl -X GET "https://api.apis.guru/v2/specs/httpbin.org/0.9.2/drip?code=200&delay=2&duration=2&numbytes=10"
import requests
params = {
"code": "200",
"delay": "2",
"duration": "2",
"numbytes": "10"
}
response = requests.get(
"https://api.apis.guru/v2/specs/httpbin.org/0.9.2/drip",
params=params,
)
print(response.json())const url = new URL('https://api.apis.guru/v2/specs/httpbin.org/0.9.2/drip');
url.searchParams.set('code', '200');
url.searchParams.set('delay', '2');
url.searchParams.set('duration', '2');
url.searchParams.set('numbytes', '10');
const response = await fetch(url);
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://api.apis.guru/v2/specs/httpbin.org/0.9.2/drip")
q := baseURL.Query()
q.Set("code", "200")
q.Set("delay", "2")
q.Set("duration", "2")
q.Set("numbytes", "10")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.apis.guru/v2/specs/httpbin.org/0.9.2/drip")
uri.query = URI.encode_www_form({
"code" => "200",
"delay" => "2",
"duration" => "2",
"numbytes" => "10"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.apis.guru/v2/specs/httpbin.org/0.9.2/drip?" . http_build_query([
"code" => "200",
"delay" => "2",
"duration" => "2",
"numbytes" => "10"
]);
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));302/3XX Redirects to the given URL.
Hover any highlighted part to learn what it does
curl -X GET "https://api.apis.guru/v2/specs/httpbin.org/0.9.2/redirect-to?url=https%3A%2F%2Fexample.com&status_code=1"
import requests
params = {
"url": "https://example.com",
"status_code": "1"
}
response = requests.get(
"https://api.apis.guru/v2/specs/httpbin.org/0.9.2/redirect-to",
params=params,
)
print(response.json())const url = new URL('https://api.apis.guru/v2/specs/httpbin.org/0.9.2/redirect-to');
url.searchParams.set('url', 'https://example.com');
url.searchParams.set('status_code', '1');
const response = await fetch(url);
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://api.apis.guru/v2/specs/httpbin.org/0.9.2/redirect-to")
q := baseURL.Query()
q.Set("url", "https://example.com")
q.Set("status_code", "1")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.apis.guru/v2/specs/httpbin.org/0.9.2/redirect-to")
uri.query = URI.encode_www_form({
"url" => "https://example.com",
"status_code" => "1"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.apis.guru/v2/specs/httpbin.org/0.9.2/redirect-to?" . http_build_query([
"url" => "https://example.com",
"status_code" => "1"
]);
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Returns a set of response headers from the query string.
Hover any highlighted part to learn what it does
curl -X GET "https://api.apis.guru/v2/specs/httpbin.org/0.9.2/response-headers?freeform=example"
import requests
params = {
"freeform": "example"
}
response = requests.get(
"https://api.apis.guru/v2/specs/httpbin.org/0.9.2/response-headers",
params=params,
)
print(response.json())const url = new URL('https://api.apis.guru/v2/specs/httpbin.org/0.9.2/response-headers');
url.searchParams.set('freeform', 'example');
const response = await fetch(url);
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://api.apis.guru/v2/specs/httpbin.org/0.9.2/response-headers")
q := baseURL.Query()
q.Set("freeform", "example")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.apis.guru/v2/specs/httpbin.org/0.9.2/response-headers")
uri.query = URI.encode_www_form({
"freeform" => "example"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.apis.guru/v2/specs/httpbin.org/0.9.2/response-headers?" . http_build_query([
"freeform" => "example"
]);
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Postman Setup Guide
- See official documentation for authentication and setup.
What can you build with httpbin.org?
httpbin.org is a Developer Tools API. Developers commonly use developer tools APIs for:
- automating code review and quality checks
- integrating CI/CD pipelines and build systems
- managing feature flags and A/B tests
- monitoring errors and application performance
- generating and validating test data
No authentication required. This API is open — no signup or key needed. Ideal for quick prototypes and public-facing features. httpbin.org is free to use, making it a low-risk choice to experiment with.
New to APIs? Read our beginner's guide