api.xuchunyang.me · httpbin-style test API
JSON (2-space indented) · CORS * · no auth · ?seed= makes random endpoints deterministic · bad params → 400 JSON · rate limit 120 req / 60 s per IP → 429 + Retry-After
Spec: /openapi.json (OpenAPI 3.1, import into Postman/Insomnia)
curl -s https://api.xuchunyang.me/ip
curl -s -X POST https://api.xuchunyang.me/post -H 'content-type: application/json' -d '{"a":1}'
| HTTP | ||
|---|---|---|
| ANY | /anything[/*] | Echo method, url, args, headers, body, json, form |
| GET | /get | Echo GET request |
| POST | /post | Echo POST body (also PUT/PATCH/DELETE at their paths) |
| GET | /headers | Request headers |
| GET | /ip | IP, city, region, loc, timezone, ASN, ISP, colo, TLS |
| GET | /status/:code | Respond with status 100–599 (1xx → 400) |
| GET | /delay/:s | Wait 0–10 s, then echo |
| GET | /redirect/:n | n×302 (≤10), ends at /get |
| ANY | /mock | Custom response: status, body (≤64 KB), content_type, header=Name:%20value (repeatable), delay 0–10 s; or POST JSON {status,headers,body,delay} |
| Data | ||
| GET | /time?tz= | Current time, IANA tz |
| GET | /uuid?n= | 1–100 UUIDv4 |
| GET | /color?format=json|svg | Random hex/rgb/hsl or SVG swatch |
| GET | /logo?text=&size= | SVG initials logo, size 16–1024 |
| GET | /quote?lang=en|zh | Random quote with author |
| GET | /bytes/:n | n random bytes (≤1 MiB), octet-stream |
| Images (302) | ||
| GET | /image?w=&h= | Picsum, 1–4096 px |
| GET | /cat?w=&h= | Cataas |
| GET | /dog?format=json | Dog CEO; format=json returns URL |
| Geo | ||
| GET | /geo/me | Cloudflare location of the caller |
| GET | /geo/countries | 250 countries (en/zh, iso2/3, flag, capital, currency, calling code) |
| GET | /geo/country/:code | Lookup by ISO2/ISO3 |
| GET | /geo/random | Random country |
| Files | ||
| GET | /files/sample.{json,csv,txt,svg,png} | Static sample files |
| Meta | ||
| GET | /openapi.json | OpenAPI 3.1 spec |
Cloudflare Workers · http & https