Google CSE API出现400错误求助:昨日正常今日异常,多设备复现
Hey there, sorry to hear this 400 error popped up out of nowhere with your Google Custom Search API—super frustrating when something that worked flawlessly yesterday stops cold. Let me share what I've seen from other users and some quick checks you can run:
First, to answer your core question: Yes, several users have reported identical sudden 400 errors with the CSE API over the last 24 hours across different Stack Exchange communities. Most cases trace back to a few common triggers:
- API Quota Depletion: Even if you're on a free tier, it's easy to hit the daily request limit without noticing. Sometimes Google returns a 400 instead of the more obvious 429 "too many requests" error for quota issues. Head to your Google Cloud Console to verify your remaining quota for the Custom Search API.
- Unexpected Changes to Your Custom Search Engine (CX ID): It's rare, but occasionally Google's backend might flag or adjust your search engine configuration (e.g., if your search scope includes restricted content, or if the engine was marked inactive). Double-check your engine status in the Google Custom Search Console to confirm it's still active and configured correctly.
- Temporary API Service Fluctuations: Google's services can have minor, unreported blips that affect small subsets of users. Even if the official status page shows everything is green, other users might be experiencing the same issue as you.
- Request Parameter Edge Cases: Looking at your request URL, the
qparameter is set tosearch+test%3F(which decodes tosearch test?). While this worked yesterday, it's worth testing a simplified query (without the trailing question mark) to rule out any unexpected encoding issues that might have started being enforced.
If none of these checks resolve the issue, I'd recommend posting your full error response (redacting sensitive info like your API key) in the Stack Overflow Google Cloud tag—other users who've fixed this exact issue might chime in with more specific fixes.
内容的提问来源于stack exchange,提问作者profound.donut

