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

# Search the Masnavi by meaning (any language)

`GET /api/search_meaning`

## Request

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

Semantic search: finds the beyts closest in MEANING to the query, not the ones containing its words. The query can be in ANY language — English, Persian, Spanish, Turkish, Arabic, … — e.g. 'feeling separated from your origin' → M1:1. Each hit carries a cosine-similarity score. Complements /api/search (lexical, Persian). status='unavailable' means the vector index is not built yet.

## Query parameters

- `q` string, required: What the verse should MEAN, in any language.
- `daftar` integer, nullable: Restrict to a single daftar (1-6).
- `limit` integer: Max results to return.

## Response `200`

Successful Response

- MeaningSearchResponse
  - `query` string, required
  - `status` string: 'ok' | 'unavailable' (index not built / no key) | 'error'
  - `total_indexed` integer
  - `results` MeaningHit[]
    - `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
    - `score` number, required: Cosine similarity between query and beyt, 0..1
  - `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)
