# Entity Rankings

Returns per-prompt ranking data for all tracked entities, showing where each entity ranks in AI responses for each monitored prompt.

## Request

```
GET /v1/prompts/rankings
```

### Query Parameters

All [common filters](/getting-started/filtering.md) are supported:

| Parameter   | Type              | Required | Default     | Description            |
| ----------- | ----------------- | -------- | ----------- | ---------------------- |
| `startDate` | string (ISO 8601) | No       | 30 days ago | Start of date range    |
| `endDate`   | string (ISO 8601) | No       | Today       | End of date range      |
| `providers` | string\[]         | No       | All         | Filter by AI provider  |
| `topicIds`  | string\[]         | No       | All         | Filter by topic        |
| `countries` | string\[]         | No       | All         | Filter by country code |
| `search`    | string            | No       | —           | Search prompt text     |

## Response

### Success (200 OK)

```json
[
  {
    "entity": "Acme",
    "runId": "550e8400-e29b-41d4-a716-446655440010",
    "runDate": "2026-03-15T00:00:00Z",
    "promptRank": 1,
    "appearanceCount": 847
  },
  {
    "entity": "Globex",
    "runId": "550e8400-e29b-41d4-a716-446655440010",
    "runDate": "2026-03-15T00:00:00Z",
    "promptRank": 2,
    "appearanceCount": 623
  },
  {
    "entity": "Initech",
    "runId": "550e8400-e29b-41d4-a716-446655440010",
    "runDate": "2026-03-15T00:00:00Z",
    "promptRank": 3,
    "appearanceCount": 512
  }
]
```

### Fields

| Field             | Type              | Description                               |
| ----------------- | ----------------- | ----------------------------------------- |
| `entity`          | string            | Entity name                               |
| `runId`           | string (UUID)     | Analysis run ID                           |
| `runDate`         | string (ISO 8601) | Date of the analysis run                  |
| `promptRank`      | integer or null   | Entity's rank position (1 = most visible) |
| `appearanceCount` | integer or null   | Total appearances across prompts          |

## Examples

### curl

```bash
curl "https://app.limy.ai/api/v1/prompts/rankings?\
providers=OPENAI&topicIds=550e8400-e29b-41d4-a716-446655440020" \
  -H "X-API-Key: YOUR_API_KEY"
```

### Python

```python
response = requests.get(
    f"https://app.limy.ai/api/v1/prompts/rankings",
    headers={"X-API-Key": API_KEY},
    params={"providers": ["OPENAI", "GEMINI"]}
)

for entity in response.json():
    rank = entity['promptRank'] or 'N/A'
    print(f"#{rank} {entity['entity']}: {entity['appearanceCount']} appearances")
```

### JavaScript

```javascript
const response = await fetch(
  `https://app.limy.ai/api/v1/prompts/rankings`,
  { headers: { 'X-API-Key': API_KEY } }
);

const rankings = await response.json();
rankings.forEach(r =>
  console.log(`#${r.promptRank} ${r.entity}: ${r.appearanceCount} appearances`)
);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api-reference.limy.ai/analytics/avg-rank/rankings.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
