Search
Knowledge & Search
Search
Execute semantic search queries across your codebase
GET
Search
Overview
The Search endpoint provides semantic search capabilities across your indexed repositories and workspaces. It intelligently searches through code, finding relevant results based on the meaning of your query, not just keyword matching.Request
Query Parameters
The search query string. Describes what you’re looking for in natural language or keywords.
Array of data source IDs to search within. If omitted, searches across all available data sources.
Alternative to
DataSourceIds — array of data source names to search within. You can also pass workspace names here to search across all repositories in a workspace.Search mode to use. Options:
Auto(default): Automatically selects the best modeFast: Quick search with good resultsFastComplex: Fast search optimized for complex queriesDeep: Thorough search with more comprehensive results
Whether to include the full content of search results. Set to
true to get the actual code content.
Note: MCP server and Skills always use IncludeContent=false — use the /api/search/artifacts endpoint to fetch content separately.Level of detail for result descriptions. Options:
Short(default): Brief summary of each resultFull: More detailed description of each result
Response
Array of search result objects
Code Examples
Search by Data Source
You can limit search to specific repositories or workspaces:Example Response
Search Modes
Auto Mode (Recommended)
Automatically selects the best search strategy based on your query complexity:Fast Mode
Quick results for simple queries:Fast Complex Mode
Optimized for complex queries while maintaining speed:Deep Mode
Comprehensive search with more thorough analysis:Use Cases
Finding Implementation Details
Code Review Assistance
Security Audit
Error Responses
400 Bad Request
401 Unauthorized
500 Internal Server Error
Best Practices
Optimize Query Performance
Optimize Query Performance
- Use
Fastmode for simple identifier lookups - Use
Deepmode only when you need comprehensive results - Specify data sources to narrow search scope
- Set
IncludeContent=falsewhen you only need locations
Write Effective Queries
Write Effective Queries
- Use natural language to describe what you’re looking for
- Be specific about the context (e.g., “JWT authentication” vs “authentication”)
- Include relevant technical terms and concepts
- For complex queries, use
DeeporFastComplexmode
Process Results Efficiently
Process Results Efficiently
- Sort results by score to prioritize most relevant matches
- Use snippet for quick overview before loading full content
- Combine with Chat API for deeper analysis of results
Search Then Fetch Workflow
Search Then Fetch Workflow
For best performance, use a two-step approach:
- Search with
IncludeContent=falseto get file paths, descriptions, and identifiers - Fetch content only for relevant results using
POST /api/search/artifacts
DescriptionDetail=Full to get richer descriptions that help you decide which artifacts to fetch.MCP server and Skills always use this pattern — they never send IncludeContent=true.