You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Google API Key触发OVER_QUERY_LIMIT错误排查请求(配额未耗尽)

Troubleshooting OVER_QUERY_LIMIT Errors for Google Geocoding & Distance Matrix API (Quota Not Exhausted)

Hey, sorry you're dealing with this annoying OVER_QUERY_LIMIT problem—especially since your quotas are still intact. Let's go through some actionable checks to get your Geocoding and Distance Matrix APIs back on track:

  • Check per-request rate limits (not just daily quotas)
    Google’s APIs enforce strict per-second and per-minute rate limits on top of daily quotas. Even if your daily usage is way under the cap, a sudden burst of requests or unoptimized batch calls can trigger this error. Head to your Google Cloud Console > APIs & Services > Dashboard, select each API (Geocoding and Distance Matrix), and check the "Quota" section for per-minute limits. If you’re exceeding these, implement request throttling, add delays between batch calls, or optimize your app to cache repeated requests (like geocoding the same address multiple times).

  • Verify API key restrictions
    Misconfigured or accidentally changed key restrictions are a common culprit here. Double-check your key settings:

    1. Go to Google Cloud Console > APIs & Services > Credentials
    2. Select the problematic API key
    3. Confirm:
      • The Geocoding API and Distance Matrix API are explicitly listed under "API restrictions" (no "None" or incorrect APIs)
      • IP/referrer restrictions match your app’s deployment (e.g., if you added a new server IP recently, it might not be whitelisted; referrer wildcards like *.yourdomain.com/* need to be formatted correctly)
      • No typos or outdated rules that might block valid requests
  • Check for project-level quota anomalies
    Sometimes backend changes on Google’s end or pending quota adjustments can cause temporary mismatches. Try:

    • Refreshing your Cloud Console page to ensure you’re viewing the latest quota data
    • Navigating to the "Quota Details" page for each API to look for hidden restrictions or pending requests
    • Reverting any recent project settings (like enabling new APIs) temporarily to see if the issue resolves
  • Test with a temporary unrestricted key (for debugging)
    Create a new API key with no restrictions (only for testing purposes!) and use it to send a few test requests. If this works, it confirms your existing key’s restrictions are causing the problem. Don’t forget to delete this test key afterward to avoid security risks.

  • Rule out Google service outages
    Rarely, regional or service-specific outages can trigger unexpected rate-limit errors. Check Google’s official Cloud Status page to see if there are reported issues with Geocoding or Distance Matrix API in your region.

  • Validate request formatting
    Malformed requests (e.g., invalid coordinates, overly long addresses, or missing required parameters) can sometimes be misclassified as over-limit errors. Spot-check a few recent requests against Google’s official API docs:

    • For Geocoding: Ensure addresses are properly formatted, and avoid sending duplicate requests (cache results whenever possible)
    • For Distance Matrix: Stick to the maximum allowed origin/destination pairs per call, and verify all locations are valid

If none of these steps resolve the issue, reach out to Google Cloud Support with your project ID, API key details, and sample request/response logs—this will help them diagnose the problem faster.

内容的提问来源于stack exchange,提问作者coolneo

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.22 08:05:39