Skip to main content

Search API

The Search API provides unified full-text search over catalog entities and indexed documentation. Results are merged and sorted by score. Rate limit: 60 requests per minute per user (or IP if unauthenticated).

Base path: /api/v1/search.


GET /api/v1/search

Searches across entities and/or docs depending on scope. Response includes data (items with type, id, title, excerpt, url, score, meta), pagination, query, and scope.

Auth

entity:read

Query parameters

ParameterTypeDefaultDescription
qstringRequired. Search query (1–200 chars).
scopestringallOne of: all, entities, docs. entities = catalog only; docs = indexed docs only; all = both.
offsetnumber0Pagination offset.
limitnumber20Page size (1–50).

Response

200 OK

{
"data": [
{
"type": "entity",
"id": "entity-uuid",
"title": "my-service",
"excerpt": "Backend service for ...",
"url": "/catalog/entity/entity-uuid",
"score": 0.95,
"meta": {
"kind": "service",
"namespace": "default",
"name": "my-service",
"owner_ref": "github.com/my-org",
"lifecycle": "production"
}
},
{
"type": "doc",
"id": "doc-uuid",
"title": "README.md",
"excerpt": "...",
"url": "/catalog/entity/entity-uuid/docs/README.md",
"score": 0.8,
"meta": {
"entity_id": "entity-uuid",
"path": "README.md"
}
}
],
"pagination": { "offset": 0, "limit": 20, "total": 2 },
"query": "service",
"scope": "all"
}

Response includes a Cache-Control header (e.g. private, max-age=10).

Errors

StatusCondition
400Missing or invalid q (empty or too long), or invalid scope
401Not authenticated
403Missing entity:read
429Rate limit exceeded (60 req/min). Response includes Retry-After header.

Example

curl -s -b cookies.txt "https://forgeportal.example.com/api/v1/search?q=api&scope=entities&limit=10&offset=0"
curl -s -b cookies.txt "https://forgeportal.example.com/api/v1/search?q=readme&scope=docs"