grep-app
Use when searching for code patterns, library usage, API examples, or implementations across public GitHub repositories. Triggers on "search GitHub code for", "how do other projects use X", "find examples of", "grep.app", or needing to discover how open-source projects implement specific functionality.
Documentation
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?