For the complete documentation index, see llms.txt. This page is also available as Markdown.

Full-text search across all pages in a space

Searches the full text of all published pages in a space and returns matching pages with ranked excerpts. Use this to find pages by topic or keyword within a specific space. For site-wide search across all spaces in a site, use the site search endpoint instead.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
spaceIdstringRequired

A unique entity identifier

Pattern: ^[a-zA-Z0-9_-]+$
Query parameters
querystring · max: 512Required
pagestringOptional

Identifier of the page results to fetch.

limitnumber · max: 1000Optional

The number of results per page

Responses
200

OK

application/json
countnumberOptional

Total count of objects in the list

get/spaces/{spaceId}/search
GET /v1/spaces/{spaceId}/search?query=text HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

OK

{
  "next": {
    "page": "text"
  },
  "count": 1,
  "items": [
    {
      "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?

Powered by GitBook