Search
Search across all indexed repositories POST /api/v1/search
Code Search provides a comprehensive REST API for integrating search into your workflows.
http://localhost:8080/api/v1Or for production:
https://your-code-search-domain.com/api/v1Currently, the API does not require authentication for local deployments. For production deployments, Bearer token authentication can be configured.
Search
Search across all indexed repositories POST /api/v1/search
Repositories
List and manage repositories GET /api/v1/repos
Connections
Manage code host connections GET /api/v1/connections
Jobs
Monitor background jobs GET /api/v1/jobs
SCIP
Precise code intelligence (go-to-definition, find-references) POST /api/v1/scip/repos/{id}/definition
Replace
Search and replace across repositories POST /api/v1/replace/execute
All requests should include:
Content-Type: application/jsonAccept: application/jsonAll responses are JSON. The format varies by endpoint:
{ "results": [...], "total_count": 100, "duration": "15ms", "stats": { "files_searched": 1234, "repos_searched": 45 }}{ "repos": [...], "total_count": 50}{ "error": "Invalid query parameter"}Or plain text error message with appropriate HTTP status code.
| Code | Description |
|---|---|
| 200 | Success |
| 201 | Created |
| 400 | Bad request |
| 401 | Unauthorized |
| 404 | Not found |
| 500 | Server error |
List endpoints support pagination using limit and offset:
GET /api/v1/jobs?limit=50&offset=100Response includes pagination metadata:
{ "jobs": [...], "total_count": 150, "limit": 50, "offset": 100, "has_more": false}API requests have the following timeout limits:
| Operation | Timeout |
|---|---|
| Read | 15s |
| Write | 60s |
# Search (POST request with JSON body)curl -X POST "http://localhost:8080/api/v1/search" \ -H "Content-Type: application/json" \ -d '{"query": "handleRequest"}'
# List reposcurl "http://localhost:8080/api/v1/repos"
# List jobs with filterscurl "http://localhost:8080/api/v1/jobs?status=running&type=index"// Search (POST request)const response = await fetch("http://localhost:8080/api/v1/search", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ query: "handleRequest" }),});const data = await response.json();console.log(data.results);import requests
response = requests.post( 'http://localhost:8080/api/v1/search', json={'query': 'handleRequest'})data = response.json()print(data['results'])payload := map[string]string{"query": "handleRequest"}body, _ := json.Marshal(payload)
resp, err := http.Post( "http://localhost:8080/api/v1/search", "application/json", bytes.NewBuffer(body),)if err != nil { log.Fatal(err)}defer resp.Body.Close()
var result SearchResponsejson.NewDecoder(resp.Body).Decode(&result)Code Search provides a complete OpenAPI 3.1 specification and interactive Swagger UI:
| Resource | URL | Description |
|---|---|---|
| Swagger UI | /docs | Interactive API explorer |
| OpenAPI Spec | /openapi.yaml | Full API specification (YAML) |
| OpenAPI JSON | /openapi.json | Redirects to YAML |
You can import the OpenAPI spec into tools like Postman, generate client SDKs, or use code generators.
| Category | Description |
|---|---|
| Search | Code search across repositories |
| Repositories | Repository CRUD and management |
| File Browsing | Browse files, directories, branches (can be disabled) |
| Connections | Code host connection management |
| Replace | Search & replace with MR creation |
| Symbols | Find definitions and references |
| Jobs | Background job monitoring |
| Scheduler | Sync scheduler management |
| Health | Liveness and readiness probes |
Official SDKs are planned for: