grep.app Code Search
Search across millions of public GitHub repos via grep.app API. No API key needed.
Script
python scripts/grep_app.py <query> [options]
Options
--lang python|typescript|go|...— Filter by language--repo owner/name— Filter by repository--path pattern— Filter by file path--regexp— Treat query as regex--page N— Pagination (default: 1)--limit N— Max results (default: 10)--json— Structured JSON output
Examples
# Find how projects use a specific API
python scripts/grep_app.py "flyert.com" --lang python
# Search within a specific repo
python scripts/grep_app.py "viewthread" --repo DIYgod/RSSHub
# Regex search
python scripts/grep_app.py "def search.*discuz" --regexp --lang python
# JSON output for programmatic use
python scripts/grep_app.py "openai.chat.completions" --lang python --json
Output
Default: human-readable with repo, path, GitHub URL, and code snippet.
--json: structured JSON with total, page, results[] (each with repo, path, url, snippet, matches).
Typical use cases
- Find implementations: How do other projects solve X?
- API discovery: What APIs does service Y expose? (search for domain/URL patterns)
- Library usage: Real-world examples of library Z
- Competitive research: Who else builds tools for domain W?