Full-text search across all content in a site
Performs a full-text search across all published spaces in the site and returns matching pages with relevant excerpts. Use the scope parameter to restrict the search to specific site spaces or sections. Prefer this over the space-level search when you need to search across a multi-section site in one call.
post
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
organizationIdstringRequiredPattern:
A unique entity identifier
^[a-zA-Z0-9_-]+$siteIdstringRequired
The unique id of the site
Query parameters
pagestringOptional
Identifier of the page results to fetch.
limitnumber · max: 1000Optional
The number of results per page
Body
and
anyOptional
or
or
or
Responses
200
OK
application/json
countnumberOptional
Total count of objects in the list
post/orgs/{organizationId}/sites/{siteId}/search
POST /v1/orgs/{organizationId}/sites/{siteId}/search HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 89
{
"query": "text",
"scope": {
"mode": "default",
"currentSiteSpace": "text",
"restrictTo": "text"
}
}200
OK
{
"next": {
"page": "text"
},
"count": 1,
"items": [
{
"type": "space",
"id": "text",
"title": "text",
"score": 1,
"pages": [
{
"id": "text",
"title": "text",
"description": "text",
"path": "text",
"score": 1,
"rank": 1,
"resultType": "page",
"sections": [
{
"id": "text",
"title": "text",
"path": "text",
"score": 1,
"resultType": "page",
"body": "text",
"urls": {
"app": "https://example.com"
}
}
],
"ancestors": [
{
"title": "text"
}
],
"urls": {
"app": "https://example.com"
}
}
]
}
]
}Last updated
Was this helpful?