---
title: "Rerank documents for a query"
method: GET
path: "/v1/rerank"
tags: ["Embeddings and reranking"]
---

# Rerank documents for a query

`GET /v1/rerank`

## Request

- Base URL: `https://api.dharun.dev`
- URL: `https://api.dharun.dev/v1/rerank`
- Auth: none declared

Scores how well each document answers the query, from 0 to 1, and returns them best first with their place in the request. Up to 100 documents of up to 8,000 characters; each pair is read up to 512 tokens. GET takes query and repeated document parameters; POST takes JSON.

## Query parameters

- `query` string, required
- `document` string
- `top` integer

## Response `200`

Success

- Envelope
  - `data` unknown, required
  - `meta` object, required
    - `limit` integer
    - `note` string
    - `offset` integer
    - `source` object: Where the data came from and the credit its licence asks for.
      - `attribution` string
      - `licence` string
      - `name` string
      - `retrieved` string
      - `url` string
      - `version` string
    - `total` integer

## Other responses

- `400`: Error
- `404`: Error
- `429`: Error

---

[API](https://skmtc.dev/dharun/apis/india-api-free-open-source-apis-for-indian-data.md) · [All operations](https://skmtc.dev/dharun/apis/india-api-free-open-source-apis-for-indian-data/llms.txt) · [OpenAPI document](https://skmtc.dev/dharun/apis/india-api-free-open-source-apis-for-indian-data/revisions/ecd8b0ec7863?raw)
