Skip to main content
POST
/
search
/
universal
Universal search across all public sources
curl --request POST \
  --url https://apigcp.trynia.ai/v2/search/universal \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "query": "How does authentication work in FastAPI?",
  "top_k": 20,
  "include_repos": true,
  "include_docs": true,
  "alpha": 0.7,
  "compress_output": false
}
'
{
  "results": [
    {
      "content": "<string>",
      "score": 123,
      "source": {
        "type": "repository",
        "url": "<string>",
        "namespace": "<string>",
        "file_path": "<string>",
        "display_name": "<string>"
      }
    }
  ],
  "sources_searched": 123,
  "query_time_ms": 123,
  "errors": [
    "<string>"
  ],
  "answer": "<string>"
}

Authorizations

Authorization
string
header
required

API key must be provided in the Authorization header

Body

application/json
query
string
required

Natural language search query

Example:

"How does authentication work in FastAPI?"

top_k
integer
default:20

Total number of results to return

Required range: 1 <= x <= 100
include_repos
boolean
default:true

Include repository sources in search

include_docs
boolean
default:true

Include documentation sources in search

alpha
number
default:0.7

Weight for vector search (1-alpha for BM25). Higher values favor semantic similarity.

Required range: 0 <= x <= 1
compress_output
boolean
default:false

Use AI to compress results into a concise answer with citations

Response

Search completed successfully

results
object[]
sources_searched
integer

Number of source namespaces searched

query_time_ms
integer

Total query time in milliseconds

errors
string[] | null

Any errors encountered during search

answer
string | null

AI-compressed answer (only when compress_output=true)