Skip to main content

Status codes

Invalid search queries

Some search queries can never return results, because X rejects them. Advanced search, bulk search and tweet filter rules return 400 with an explanation for these, and you are not charged: In bulk search, only the invalid query gets an error field and empty results; the other queries in the batch run normally.
  • Retry: 429, 500, 502, 503, network timeouts. Use exponential backoff and a limit, for example up to 5 attempts.
  • Don’t retry: 400, 401, 402, 403, 404. These need a code or account change first.
  • A 402 loop is the most common mistake we see: a script keeps retrying after its credits run out. Check for 402 and stop.
Still stuck? Email [email protected] with the request URL and the time (UTC), and we’ll look it up.