The tile endpoints serve the screenshot chunk images that underlie every search hit. After aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/StarTrail-org/PixelRAG/llms.txt
Use this file to discover all available pages before exploring further.
/search call, each Hit object contains article_id, tile_index, chunk_index, and path fields. Use those values with one of the two tile endpoints to fetch the corresponding image for display or downstream processing.
Endpoint 1: By ID (Recommended)
Method:GETPath:
/tile/{article_id}/{tile_index}/{chunk_index}
Fetch a chunk image by its three-part coordinate. This is the preferred approach because it does not expose server filesystem paths and works correctly with both flat and sharded tile layouts.
Path Parameters
Sequential article position index from the search hit (
hit.article_id).Which 8192 px tile within the document (
hit.tile_index).Which 1024 px chunk within the tile (
hit.chunk_index).Response
Returns the raw image file withContent-Type: image/jpeg or Content-Type: image/png depending on the stored file extension. Returns HTTP 404 if no file is found at the resolved path.
Example
/search hit:
Endpoint 2: By Path (Legacy)
Method:GETPath:
/tile?path=<relative-path>
Fetch a tile image using the relative path returned in hit.path from a /search response. The path is resolved relative to the server’s tiles_dir. The server rejects any path that would escape the tiles directory with HTTP 403.
Relative file path to the chunk image, as returned in
hit.path from /search.Example
Tile File Layout
Tile images are stored under the server’stiles_dir in this structure:
hit.path field in search results is the path of the chunk file relative to tiles_dir — for example, 30492.png.tiles/chunk_0000_02.png.
On-Demand Rendering
When the server is started with--render-on-demand, tile images are not read from a pre-materialized tiles/ directory. Instead they are rendered on the fly from a running kiwix-serve instance and cached locally. In this mode:
hit.article_pagesis alwaysnull(no pre-existing files to inventory)- Tile images are cached after first render; subsequent requests for the same tile are served from cache
- The
--kiwix-urland optionally--zim-bookflags configure the kiwix source