---
title: "Search the Masnavi"
method: GET
path: "/api/search"
tags: ["rest"]
---

# Search the Masnavi

`GET /api/search`

## Request

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

Full-text search across all 25,635 beyts of Rumi's Masnavi-ye Maʿnavi. Returns ranked results with canonical citations. Use this to find passages on a theme, word, or phrase.

## Query parameters

- `q` string, required: Persian text to search for. Diacritic-insensitive.
- `daftar` integer, nullable: Restrict to a single daftar (1-6).
- `limit` integer: Max results to return.
- `offset` integer: Pagination offset.

## Response `200`

Successful Response

- SearchResponse
  - `query` string, required
  - `total` integer, required
  - `results` SearchHit[], required
    - `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
    - `rank` number, nullable
  - `match` string

## 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)
