[API Request]: Complete Book data as JSON #2525

Open
opened 2026-02-05 04:24:49 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @amelszg on GitHub (Dec 13, 2021).

API Endpoint or Feature

I would like to be able to fetch complete book data (with all chapter and page details, page html content included) with single API call.

Can't exactly pinpoint what the most suitable place for this API call would be, my first hunch would be an additional export method.

/api/books/{id}/export/json

Alternatively, being able to fetch list of API "read" page results as single call would be fine as well, but not sure where such call would fit in the API.

Whatever requires least effort and maintenance to implement.

Use-Case

Fetch details for all pages via single API call to avoid making a hundreds of separate calls (1x per page).

Additional context

Json Export result would contain complete book data and would basically aggregate JSON output of current API methods:

  • "read" book result
  • collection of "read" chapter results
  • collection of "read" page results

I'm mainly in need to fetch all html content of all book pages at once. Using html export involves considerable overhead with parsing and replacing the content, since it's not the same html result as returned via page detail html property (images are embedded, there is no clear separation which html fragments belong to specific page or pageid, etc.)

Originally created by @amelszg on GitHub (Dec 13, 2021). ### API Endpoint or Feature I would like to be able to fetch complete book data (with all chapter and page details, page html content included) with single API call. Can't exactly pinpoint what the most suitable place for this API call would be, my first hunch would be an additional export method. /api/books/{id}/export/json Alternatively, being able to fetch list of API "read" page results as single call would be fine as well, but not sure where such call would fit in the API. Whatever requires least effort and maintenance to implement. ### Use-Case Fetch details for all pages via single API call to avoid making a hundreds of separate calls (1x per page). ### Additional context Json Export result would contain complete book data and would basically aggregate JSON output of current API methods: - "read" book result - collection of "read" chapter results - collection of "read" page results I'm mainly in need to fetch all html content of all book pages at once. Using html export involves considerable overhead with parsing and replacing the content, since it's not the same html result as returned via page detail html property (images are embedded, there is no clear separation which html fragments belong to specific page or pageid, etc.)
OVERLORD added the 🔩 API Request label 2026-02-05 04:24:49 +03:00
Author
Owner

@Skulli commented on GitHub (Aug 22, 2022):

For me it would be enough to be able to fetch all pages with their content. I would like to create a blog page. This pages lists all pages of an bookstack chapter with header and preview and click on details shows the full page.
Currently the api-call pagesonly gets you the title. If you want to show the content or preview, you have to make an api call for each page pages/:id and fetch that information.

Maybe something like /pages?with_content=true

The above request goes into a similar direction. That would be something like books/:id?with_content=true

@Skulli commented on GitHub (Aug 22, 2022): For me it would be enough to be able to fetch all pages with their content. I would like to create a blog page. This pages lists all pages of an bookstack chapter with header and preview and click on details shows the full page. Currently the api-call `pages`only gets you the title. If you want to show the content or preview, you have to make an api call for each page `pages/:id` and fetch that information. Maybe something like `/pages?with_content=true` The above request goes into a similar direction. That would be something like `books/:id?with_content=true`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2525