Supports most of the endpoints from the original httpbin.org, including:
All endpoints accept any HTTP method. Additionally, it includes features not found in the original httpbin:
/ip returns the requester's IP address along with geolocation information such as country, region, city, ASN, and more.
{
"origin": "2408:8240:e10:947c:2806:6bb2:c222:343c",
"continent": "AS",
"latitude": "30.29365",
"longitude": "120.16142",
"country": "CN",
"region": "Zhejiang",
"regionCode": "ZJ",
"city": "Hangzhou",
"postalCode": "310000",
"timezone": "Asia/Shanghai",
"asn": 4837,
"asOrganization": "China Unicom",
"colo": "LAX"
}
/ws echoes back any message sent to it over a WebSocket connection. You can test it using wscat:
wscat -c wss://edgebin.liujiacai.net/ws
/qrcode generates QR codes(svg) for any text or URL. Use query parameters to customize the output:
text: The text or URL to encode (required)errorCorrectionLevel: Error correction level, one of L, M, Q, H. Default is H.width: Width of the QR code in pixels. Default is 350.margin: Define how much wide the quiet zone should be. Default is 4.scale: Scale factor. A value of 1 means 1px per modules (black dots). Default is 4./md2html, /html2md converts between html and markdown. Use following methods to pass data:
POST request with raw bodyurl query parameter to convert a webpagetext query parameter to convert a short text.curl "https://edgebin.liujiacai.net/md2html" --data "# Hello, World"
curl "https://edgebin.liujiacai.net/html2md" --data "<h1>Hello, World</h1>"
/page-meta: Fetches a webpage and extracts its metadata (title, description, image, etc.). Use the url query parameter to specify the target webpage.
/date: Returns current date and time. Supports the following query parameters to control output:
format: Output format. One of iso, locale, ts, timestamp, utc. Default is iso.locale: BCP47 locale string, e.g., en-US, zh-CN. Used when format=locale.timeZone: IANA time zone, e.g., Asia/Shanghai./mix returns what you send in the request body, and supports specific query strings as directives to construct a custom response.
s=code, sets the status code, e.g. s=418h=key:value, adds a response header, e.g. h=Content-Type:text/plaind=delay, delays the response by delay seconds, e.g. d=3/get: Returns GET data/ip: Returns the requester's IP address/ipgeo: Returns the requester's IP address and geolocation information/user-agent: Returns the requester's User-Agent/headers: Returns the requester's HTTP headers/status/:code: Returns a response with the given status code/anything: Returns anything that was sent in the request/delay/:n: Delays responding for n seconds/redirect/:n: Redirects n times/basic-auth/:user/:passwd: Challenges HTTP Basic Auth/bearer: Challenges HTTP Bearer Auth/cache/:max-age: Returns a response with Cache-Control: public, max-age=60/response-headers?key=value: Returns a response with the given headers/bytes/:n: Returns n random bytes/xml: Returns a sample XML document/html: Returns a sample HTML document/json: Returns a sample JSON document/csv/:name/:limit: Returns a sample CSV dataset/csv defaults to customers with a limit of 100name can be customers, leads, organizations, people, or productslimit can be 100 or 1000/gzip: Returns a gzip-encoded response/brotli: Returns a brotli-encoded response/deflate: Returns a deflate-encoded response/anything/:anything: Returns anything that was sent in the request/cookies: Returns the requester's cookies/cookies/set?name=value: Sets cookies and redirects to /cookies/cookies/delete?name=value: Deletes cookies and redirects to /cookies/image/:type: Returns a random image of the given type (png, jpeg, webp, svg)If you find an endpoint is missing or notice any unexpected behavior, we welcome you to open an issue or submit a pull request.
# clone the repo and install dependencies
git clone https://github.com/jiacai2050/edgebin.git && cd edgebin
npm install
# start development server, listen on http://localhost:8787
npm run dev
# Deploy to Cloudflare Workers
# Make sure to set up your Cloudflare Workers environment first
# https://developers.cloudflare.com/workers/get-started/guide/
npm run deploy
In the future, we may support other edge platforms like Vercel Edge Functions and Deno Deploy.