sundowndev/phoneinfoga · error

rate limit exceeded, see https://developers.google.com/custo

Error message

rate limit exceeded, see https://developers.google.com/custom-search/v1/overview#pricing

What it means

During Run, each dork query goes through the Google Custom Search JSON API; when s.isRateLimit(err) detects a rate-limit/quota HTTP error, the scanner replaces the raw API error with 'rate limit exceeded, see https://developers.google.com/custom-search/v1/overview#pricing'.

Source

Thrown at lib/remote/googlecse_scanner.go:96

	var cx = opts.GetStringEnv("GOOGLECSE_CX")
	var apikey = opts.GetStringEnv("GOOGLE_API_KEY")

	dorks = append(dorks, s.generateDorkQueries(n)...)

	customsearchService, err := customsearch.NewService(
		context.Background(),
		option.WithAPIKey(apikey),
		option.WithHTTPClient(s.httpClient),
	)
	if err != nil {
		return nil, err
	}

	for _, req := range dorks {
		n, items, err := s.search(customsearchService, req.Dork, cx)
		if err != nil {
			if s.isRateLimit(err) {
				return nil, errors.New("rate limit exceeded, see https://developers.google.com/custom-search/v1/overview#pricing")
			}
			return nil, err
		}
		allItems = append(allItems, items...)
		totalResultCount += n
		totalRequestCount++
	}

	var data GoogleCSEScannerResponse
	for _, item := range allItems {
		data.Items = append(data.Items, ResultItem{
			Title: item.Title,
			URL:   item.Link,
		})
	}
	data.Homepage = fmt.Sprintf("https://cse.google.com/cse?cx=%s", cx)
	data.ResultCount = len(allItems)
	data.TotalResultCount = totalResultCount

View on GitHub (pinned to 55807b05b7)

Solutions

  1. Wait until the quota window resets (daily quota resets at midnight Pacific Time) and retry
  2. Enable paid billing for Custom Search JSON API to raise the daily query cap
  3. Reduce query volume: limit scanners/dorks per run, cache results, or add delays between scans
  4. Use a different Google Cloud project/API key with remaining quota

Example fix

// before
for n in $(cat numbers.txt); do scan --number $n; done   # quota exhausted after ~100 queries
// after
for n in $(cat numbers.txt); do scan --number $n; sleep 60; done  # spread usage, monitor quota in Cloud Console
Defensive patterns

Strategy: retry

Try / catch

_, err := scanner.Run(num, opts)
if err != nil && strings.Contains(err.Error(), "rate limit exceeded") {
    // exponential backoff, then reschedule after quota window
    time.Sleep(backoff)
    return retry(num)
}
return err

Prevention

When it happens

Trigger: Issuing more Custom Search queries than the quota allows: exceeding 100 free queries/day, or the per-100-seconds user/project limits, while iterating over multiple dorks for one number.

Common situations: Scanning many phone numbers in a loop in one day, sharing one API key across team/projects so the project quota is exhausted, or paid quota not enabled in the Google Cloud console.

Related errors


AI-assisted analysis of sundowndev/phoneinfoga@55807b05b7 (2026-09-03). Data as JSON: /api/errors/ae22b18560dc0b73. Report an issue: GitHub.