---
title: "Fetch a contiguous range of beyts"
method: GET
path: "/api/range"
tags: ["rest"]
---

# Fetch a contiguous range of beyts

`GET /api/range`

## Request

- Base URL: `https://masnavi.ai`
- URL: `https://masnavi.ai/api/range`
- Auth: none declared

Returns ALL beyts between two endpoints (inclusive), grouped by section. Use this for fetching a full multi-section story in one call. Endpoints can be citations like 'M2:2608'/'M2:2775' or global indices. Max range: 500 beyts.

## Query parameters

- `start` string, nullable: Start citation, e.g. 'M2:2608'.
- `end` string, nullable: End citation, e.g. 'M2:2775'.
- `start_global` integer, nullable
- `end_global` integer, nullable

## Response `200`

Successful Response

- RangeResponse
  - `start_citation` string, required
  - `end_citation` string, required
  - `total_beyts` integer, required
  - `total_sections` integer, required
  - `sections` RangeSection[]
    - `section_id` integer, required
    - `slug` string, required
    - `title_fa` string, required
    - `daftar` integer, required
    - `order_in_parent` integer, required
    - `beyts` Beyt[]
      - `citation` string, required: Canonical citation, e.g. 'M3:1278'
      - `daftar` integer, required
      - `beyt_in_daftar` integer, required
      - `beyt_global` integer, required
      - `mesra1` string, required: First hemistich (with diacritics)
      - `mesra2` string, required: Second hemistich
      - `section_id` integer, required
      - `section_title` string, required
      - `section_slug` string, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/masnavi/apis/masnavi-ai.md) · [All operations](https://skmtc.dev/masnavi/apis/masnavi-ai/llms.txt) · [OpenAPI document](https://skmtc.dev/masnavi/apis/masnavi-ai/revisions/2622163d327c?raw)
