---
title: "Search the Divan-e Shams ghazals (full-text)"
method: GET
path: "/api/divan/search"
tags: ["rest"]
---

# Search the Divan-e Shams ghazals (full-text)

`GET /api/divan/search`

## Request

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

Full-text search across the 34,603 beyts of the ghazals of Rumi's Divan-e Shams (Divan-e Kabir). Returns beyts with divan citations (G{ghazal}:{beyt}); each links to its whole ghazal at /divan/{ghazal}. Complements /api/search (the Masnavi).

## Query parameters

- `q` string, required: Persian text to search for.
- `limit` integer
- `offset` integer

## Response `200`

Successful Response

- DivanSearchResponse
  - `query` string, required
  - `total` integer, required
  - `results` DivanSearchHit[], required
    - `citation` string, required: Canonical divan citation, e.g. 'G1393:1'
    - `ghazal` integer, required
    - `beyt_in_ghazal` integer, required
    - `mesra1` string, required
    - `mesra2` string, required
    - `ghazal_title` 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)
