---
title: "This will return a list of mappings from ID -> page num. ID will be the xhtml key and page num will be the reading order this is used to rewrite anchors in the book text so that we always load properly in our reader."
method: GET
path: "/api/Book/{chapterId}/chapters"
tags: ["Book"]
---

# This will return a list of mappings from ID -> page num. ID will be the xhtml key and page num will be the reading order this is used to rewrite anchors in the book text so that we always load properly in our reader.

`GET /api/Book/{chapterId}/chapters`

## Request

- Base URL: `http://localhost:5000`
- URL: `http://localhost:5000/api/Book/{chapterId}/chapters`
- Auth: API key in header `x-api-key`

This is essentially building the table of contents

## Path parameters

- `chapterId` integer, required

## Response `200`

OK

- BookChapterItem[]
  - `title` string, nullable
  - `part` string, nullable
  - `page` integer
  - `children` BookChapterItem[], nullable

---

[API](https://skmtc.dev/kareadita/apis/kavita.md) - [All operations](https://skmtc.dev/kareadita/apis/kavita/llms.txt) - [OpenAPI document](https://skmtc.dev/kareadita/apis/kavita/revisions/d266465eeb67?raw)
