Status codes
Invalid search queries
Some search queries can never return results, because X rejects them. Advanced search, bulk search and tweet filter rules return400 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.
Recommended retry logic
- 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
402loop is the most common mistake we see: a script keeps retrying after its credits run out. Check for402and stop.