---
title: "Search the Divan-e Shams by meaning (any language)"
method: GET
path: "/api/divan/search_meaning"
tags: ["rest"]
---

# Search the Divan-e Shams by meaning (any language)

`GET /api/divan/search_meaning`

## Request

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

Semantic search over the ghazals: given a theme, feeling, or idea in ANY language, returns the GHAZALS closest in meaning — each with its best-matching couplet as a preview and a cosine score. Couplet-level and whole-ghazal vectors are both searched. status='unavailable' means the index is not built yet.

## Query parameters

- `q` string, required: What the ghazal should be ABOUT, in any language.
- `limit` integer

## Response `200`

Successful Response

- DivanMeaningResponse
  - `query` string, required
  - `status` string
  - `total_indexed_beyts` integer
  - `total_indexed_ghazals` integer
  - `results` DivanMeaningHit[]
    - `ghazal` integer, required
    - `citation` string, required
    - `slug` string, required
    - `title_fa` string, required
    - `beyt_count` integer, required
    - `score` number, required: Best cosine similarity for this ghazal, 0..1
    - `match_kind` string, required: 'beyt' (a couplet matched), 'ghazal' (the whole ghazal's theme matched), or 'both'
    - `best_beyt` GhazalBeyt
      - `citation` string, required: Canonical divan citation, e.g. 'G1393:1'
      - `ghazal` integer, required
      - `beyt_in_ghazal` integer, required
      - `mesra1` string, required
      - `mesra2` string, required
    - `best_beyt_score` number, nullable
  - `note` 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)
