HTTP 418 I’m a teapot: what it means and why you got it
Meaning
HTTP 418 I'm a teapot is a reserved joke code. Why real sites, WAFs and APIs still send it to scrapers, a local repro, and what to change.
HTTP 418 is the joke status code “I’m a teapot”. It comes from RFC 2324, section 2.3.2, an April Fools’ RFC about controlling coffee pots over HTTP, where a teapot asked to brew coffee answers 418. It is not part of HTTP proper. RFC 9110, section 15.5.19 lists 418 as “(Unused)” and reserves it, because the joke was deployed often enough that the number cannot safely be given another meaning.
So when a real website sends you a 418, nobody is making tea. The server is refusing the request with a code it picked for itself, and the code alone does not say why. In the documented cases below, the sender is a WAF, an API rate limiter or a filter on automated traffic.
One code, several spellings
| Source | What it says for 418 |
|---|---|
| RFC 2324, section 2.3.2 | I’m a teapot |
| RFC 7168, section 2.3.3 (the tea extension) | I’m a Teapot |
| RFC 9110, section 15.5.19, and the IANA registry | (Unused), reserved |
Python 3.15.0, http.HTTPStatus(418).phrase |
I’m a Teapot (added in Python 3.9 as IM_A_TEAPOT) |
Node.js v24.2.0, http.STATUS_CODES[418] |
I’m a Teapot |
The capital T in Python and Node matches the heading in RFC 7168, not the original. It makes no difference on the wire: clients act on the number, and HTTP/2 does not send a reason phrase at all.
Reproduce it locally
This Node.js server does what some sites do: it refuses requests whose User-Agent looks like a script and serves everyone else.
// teapot.mjs: refuses script user agents with 418, like some sites do
import http from 'node:http';
const scripted = /^(curl|python-requests|python-httpx|Go-http-client)\//;
http.createServer((req, res) => {
if (scripted.test(req.headers['user-agent'] ?? '')) {
res.writeHead(418, { 'Content-Type': 'text/plain', 'Retry-After': '120' });
res.end('Automated requests are not accepted.\n');
return;
}
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end('Hello, browser.\n');
}).listen(8418, '127.0.0.1');
Start it with node teapot.mjs. Real output from Node v24.2.0 and curl 8.7.1, Date header removed:
$ curl -si http://127.0.0.1:8418/ | grep -v "^Date:"
HTTP/1.1 418 I'm a Teapot
Content-Type: text/plain
Retry-After: 120
Connection: keep-alive
Keep-Alive: timeout=5
Transfer-Encoding: chunked
Automated requests are not accepted.
$ curl -s -o /dev/null -w "%{http_code}\n" -A "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)" http://127.0.0.1:8418/
200
Same machine, same address, different answer. The rule matched curl’s default curl/8.7.1 header, not the IP. What libraries send before you change anything is measured in what HTTP clients send by default.
Who sends a real 418
Google keeps one as an easter egg, and it answers over HTTP/2 with the bare number:
$ curl -s -o /dev/null -D - https://www.google.com/teapot | head -1
HTTP/2 418
The ones that matter for scraping are documented by the services that send them:
- Binance’s API answers 429 when a client breaks a request rate limit, and 418 when an IP has been auto-banned for continuing to send requests after those 429s. Its documentation says bans escalate for repeat offenders, from 2 minutes to 3 days, and both responses carry a Retry-After header giving the seconds to wait.
- Huawei Cloud WAF reports error 418 when it intercepts a request carrying what it judges to be a malicious payload. Its FAQ tells site owners to check the protection logs and, for a false alarm, to handle it so it does not recur.
- MDN notes that some websites use 418 for requests they do not wish to handle, such as automated queries.
What to change when your scraper gets one
Stop first. A 418 that follows a run of 429s, as in Binance’s case, is the second step of an escalation, and continuing turns a short ban into a longer one. Read Retry-After if it is present and wait at least that long; exponential backoff covers what to do when it is absent.
Then find the trigger, because the fix depends on it. Run the same request without the proxy, then with a different client, then at a lower rate. Whichever change flips the answer tells you what the rule keys on. If the IP was not the trigger, switching to new exits through rotating sessions only repeats the refusal from more addresses.
| Trigger | How to tell | What to change |
|---|---|---|
| Rate limit escalation | 429 responses came first, then 418, usually with Retry-After |
Wait out the ban, then stay under the documented request limits and stop on the first 429 |
| WAF payload rule | 418 only on certain URLs, parameters or request bodies | Remove what looks like an attack string from the request; on your own site, review the WAF event and mark it a false alarm |
| Client signature rule | 418 with a library User-Agent, 200 with a browser one, same IP | The address is not the problem; review the headers your client sends and the site’s terms |
| Something between you and the site | The 418 also appears on unrelated hosts through the same proxy | Test without the proxy and read the response’s Server header to see who answered |
| Your own code or mock server | 418 appears in tests or a framework default | Use a registered code instead: 403 for refusals, 429 for rate limits, 503 for overload |
For the registered codes that usually carry the same message, see 403 vs 407 vs 429.
Frequently asked questions
Is 418 a real HTTP status code?
Why did a website return 418 to my scraper?
Should I retry after a 418?
Should my own API return 418?
Sources
- RFC 9110: HTTP Semantics, section 15.5.19, 418 (Unused)
- RFC 2324: Hyper Text Coffee Pot Control Protocol, section 2.3.2, 418 I'm a teapot
- RFC 7168: HTCPCP for Tea Efflux Appliances, section 2.3.3, 418 I'm a Teapot
- RFC 9110, section 15: Status Codes (unrecognized codes are treated as x00)
- IANA: HTTP Status Code Registry
- Binance Spot API documentation: limits, 429 and 418 responses
- Huawei Cloud WAF FAQ: Why Am I Seeing Error Code 418?
- MDN Web Docs: 418 I'm a teapot
- Python documentation: http.HTTPStatus