Overview
A Simple HTTP Request & Response Service
Httpbin is a development API from httpbin.org. It needs no API key. It is served over HTTPS and allows browser requests (CORS). Its OpenAPI description documents 73 endpoints.
At a glance
- Authentication
- No auth
- HTTPS
- Yes
- CORS
- Yes
- Category
- Development
- Base URL
https://httpbin.org- Version
- 0.9.2
- Endpoints
- 73
- OpenAPI
- Specification ↗
- Spec updated
- 2021-06-21
Make a first request
Replace the placeholders; the documentation says exactly where credentials go.
curl -X GET "https://httpbin.org/anything" \
-H "Accept: application/json"const response = await fetch("https://httpbin.org/anything", {
method: "GET",
headers: {
"Accept": "application/json",
},
});
const data = await response.json();
console.log(data);import requests
response = requests.request(
"GET",
"https://httpbin.org/anything",
headers={
"Accept": "application/json",
},
timeout=30,
)
print(response.json())Endpoints
| Method | Path | What it does |
|---|---|---|
| GET | /absolute-redirect/{n} | Absolutely 302 Redirects n times. |
| GET | /anything | Returns anything passed in request data. |
| POST | /anything | Returns anything passed in request data. |
| PUT | /anything | Returns anything passed in request data. |
| PATCH | /anything | Returns anything passed in request data. |
| DELETE | /anything | Returns anything passed in request data. |
| GET | /anything/{anything} | Returns anything passed in request data. |
| POST | /anything/{anything} | Returns anything passed in request data. |
| PUT | /anything/{anything} | Returns anything passed in request data. |
| PATCH | /anything/{anything} | Returns anything passed in request data. |
| DELETE | /anything/{anything} | Returns anything passed in request data. |
| GET | /base64/{value} | Decodes base64url-encoded string. |
| GET | /basic-auth/{user}/{passwd} | Prompts the user for authorization using HTTP Basic Auth. |
| GET | /bearer | Prompts the user for authorization using bearer authentication. |
| GET | /brotli | Returns Brotli-encoded data. |
| GET | /bytes/{n} | Returns n random bytes generated with given seed |
| GET | /cache | Returns a 304 if an If-Modified-Since header or If-None-Match is present. Returns the same as a GET otherwise. |
| GET | /cache/{value} | Sets a Cache-Control header for n seconds. |
| GET | /cookies | Returns cookie data. |
| GET | /cookies/delete | Deletes cookie(s) as provided by the query string and redirects to cookie list. |
| GET | /cookies/set | Sets cookie(s) as provided by the query string and redirects to cookie list. |
| GET | /cookies/set/{name}/{value} | Sets a cookie and redirects to cookie list. |
| GET | /deflate | Returns Deflate-encoded data. |
| GET | /delay/{delay} | Returns a delayed response (max of 10 seconds). |
| POST | /delay/{delay} | Returns a delayed response (max of 10 seconds). |
| PUT | /delay/{delay} | Returns a delayed response (max of 10 seconds). |
| PATCH | /delay/{delay} | Returns a delayed response (max of 10 seconds). |
| DELETE | /delay/{delay} | Returns a delayed response (max of 10 seconds). |
| DELETE | /delete | The request's DELETE parameters. |
| GET | /deny | Returns page denied by robots.txt rules. |
| GET | /digest-auth/{qop}/{user}/{passwd} | Prompts the user for authorization using Digest Auth. |
| GET | /digest-auth/{qop}/{user}/{passwd}/{algorithm} | Prompts the user for authorization using Digest Auth + Algorithm. |
| GET | /digest-auth/{qop}/{user}/{passwd}/{algorithm}/{stale_after} | Prompts the user for authorization using Digest Auth + Algorithm. |
| GET | /drip | Drips data over a duration after an optional initial delay. |
| GET | /encoding/utf8 | Returns a UTF-8 encoded body. |
| GET | /etag/{etag} | Assumes the resource has the given etag and responds to If-None-Match and If-Match headers appropriately. |
| GET | /get | The request's query parameters. |
| GET | /gzip | Returns GZip-encoded data. |
| GET | /headers | Return the incoming request's HTTP headers. |
| GET | /hidden-basic-auth/{user}/{passwd} | Prompts the user for authorization using HTTP Basic Auth. |
| GET | /html | Returns a simple HTML document. |
| GET | /image | Returns a simple image of the type suggest by the Accept header. |
| GET | /image/jpeg | Returns a simple JPEG image. |
| GET | /image/png | Returns a simple PNG image. |
| GET | /image/svg | Returns a simple SVG image. |
| GET | /image/webp | Returns a simple WEBP image. |
| GET | /ip | Returns the requester's IP Address. |
| GET | /json | Returns a simple JSON document. |
| GET | /links/{n}/{offset} | Generate a page containing n links to other pages which do the same. |
| PATCH | /patch | The request's PATCH parameters. |
| POST | /post | The request's POST parameters. |
| PUT | /put | The request's PUT parameters. |
| GET | /range/{numbytes} | Streams n random bytes generated with given seed, at given chunk size per packet. |
| GET | /redirect-to | 302/3XX Redirects to the given URL. |
| POST | /redirect-to | 302/3XX Redirects to the given URL. |
| PUT | /redirect-to | 302/3XX Redirects to the given URL. |
| PATCH | /redirect-to | 302/3XX Redirects to the given URL. |
| DELETE | /redirect-to | 302/3XX Redirects to the given URL. |
| GET | /redirect/{n} | 302 Redirects n times. |
| GET | /relative-redirect/{n} | Relatively 302 Redirects n times. |
| GET | /response-headers | Returns a set of response headers from the query string. |
| POST | /response-headers | Returns a set of response headers from the query string. |
| GET | /robots.txt | Returns some robots.txt rules. |
| GET | /status/{codes} | Return status code or random status code if more than one are given |
| POST | /status/{codes} | Return status code or random status code if more than one are given |
| PUT | /status/{codes} | Return status code or random status code if more than one are given |
| PATCH | /status/{codes} | Return status code or random status code if more than one are given |
| DELETE | /status/{codes} | Return status code or random status code if more than one are given |
| GET | /stream-bytes/{n} | Streams n random bytes generated with given seed, at given chunk size per packet. |
| GET | /stream/{n} | Stream n JSON responses |
| GET | /user-agent | Return the incoming requests's User-Agent header. |
| GET | /uuid | Return a UUID4. |
| GET | /xml | Returns a simple XML document. |
Questions
Does the Httpbin API need an API key?
No. The Httpbin API can be called without an API key or sign-up, which makes it handy for prototypes and front-end demos.
Can I call the Httpbin API from the browser?
Yes. The Httpbin API sends CORS headers, so a web page can call it directly with fetch().
Does the Httpbin API support HTTPS?
Yes, the Httpbin API is served over HTTPS.
How many endpoints does the Httpbin API have?
Its OpenAPI description lists 73 endpoints in version 0.9.2. All of them are shown on this page.
What are alternatives to the Httpbin API?
Other Development APIs include Cloudflare, Azure DevOps, IPify, App Store Connect API, StackExchange.
Similar development APIs
Compare alternatives →Cloudflare
DevelopmentManage DNS, CDN, Workers and other services; documented with an official OpenAPI 3.0 spec
Azure DevOps
DevelopmentThe Azure DevOps basic components of a REST API request/response pair
IPify
DevelopmentA simple IP Address API
App Store Connect API
DevelopmentThe data structure that represents an app store connect api resource.
StackExchange
DevelopmentQ&A forum for developers
IPinfo
DevelopmentAnother simple IP Address API
Listed from public-apis (MIT), public-apis database (MIT), APIs.guru (CC0).