## TL;DR

Unauthenticated GitHub search hits the harsh anonymous rate limit fast. Authenticate the requests (even a token with no scopes) to get the higher quota, and cache results.

## Error

```text
API rate limit exceeded for user ID (anonymous search)
```

## Steps

1. Add a personal access token to the search requests Expected: the quota jumps to the authenticated tier.
2. Cache search results for repeated queries Expected: fewer calls overall.
3. Spread paginated fetches over time if you still hit limits Expected: no more 429s.
4. Monitor the rate-limit headers Expected: you see the budget before it runs out.

## When to use

- Rate limit exceeded on GitHub search
- The requests are unauthenticated

## When not to use

- Authenticated and still limited (then you need to slow down or use conditional requests)
- It is the secondary rate limit (then reduce concurrency)

## Tool compatibility

- GitHub API rate limits
- Code search tooling

## Variant phrasings

### github search rate limit exceeded

Authenticate. Anonymous search quota is tiny.

### api rate limit for user id

Same: add a token, even one with no scopes.

## Why it happens

Search feels like browsing, so agents skip auth. GitHub's anonymous search quota is deliberately tiny.

## Edge cases

- Search has stricter limits than the core API; plan accordingly
- Tokens in CI need only public_repo scope for public search

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_nDRM0D3aeyFWOwzvLijYtg
