v1

latestOpenAPI 3.1.02026-08-066132.7 KB

Fast code search across any public git repo. Returns file paths, line numbers, and code snippets with context. Supports regex, boolean queries, fuzzy matching, and structural filters (declarations, usages, strings, comments). Dependency/build directories excluded by default.

post/api/v1/code_search

Query parameters

clientstring required

Client identifier for your application (e.g. 'my-app-v1'). Required for all REST API requests.

Request body

case_sensitiveboolean

Whether to match case-sensitively.

code_filter'only-code' | 'only-strings' | 'only-comments' | 'only-declarations' | 'only-usages'

Structural filter to narrow matches to specific code regions. only-declarations and only-usages use heuristic patterns and support 30+ languages (Go, Python, JS/TS, Rust, Java, C/C++, C#, Ruby, PHP, Kotlin, Swift, and more). For unsupported languages, all matches are classified as usages.

context_linesinteger

Lines of context before and after each match.

include_all_dirsboolean

Include dependency/build/cache directories that are excluded by default (vendor, node_modules, third_party, target, build, dist, Pods, generated, etc.). Set to true if you need to search generated/vendored code.

max_resultsinteger

Maximum number of file results to return (cap: 100).

max_matches_per_fileinteger

Maximum matches to show per file (cap: 50). Keeps responses compact for files with many hits. The response includes matches_in_file (total) so you know if more exist.

offsetinteger

Skip this many results before returning. Use for paging.

querystring required

Search query. Keywords are ANDed — use OR for exploratory multi-term searches (e.g. auth OR login OR session). Prefer single precise terms over multi-keyword phrases. Supports OR, NOT, "phrases", regex (/pattern/), fuzzy (term~1), file:, path:, lang:, ext: filters.

repositorystring required

Git URL of a public remote repository

snippet_mode'auto' | 'grep' | 'summary'

auto (ranked relevance), grep (every matching line), or summary (1 best match per file, no context — very compact). Use auto when exploring or discovering where something is used across a codebase (e.g. "how is authentication handled?"). Use grep when you know the exact identifier or string you want every occurrence of (e.g. "find all calls to parseConfig"). Use summary for broad queries where you want a compact overview of which files match.

Response

Successful response

object required