---
title: "Get the ranking"
---

> Documentation Index
> Fetch the complete documentation index at: https://api.whyviral.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get the ranking

Path: WhyViral API › Mentions

`GET /ranking`

URL: `https://whyviral.ai/api/v1/ranking`

The project’s brand beside its competitors over a period, and how often each is said or shown in the week’s most-viewed videos on the project’s topics. Free.

## Authentication

Requires one of the following:

- `bearer`, http bearer, header `Authorization`
- `apiKeyHeader`, apiKey, in header, header `x-api-key`

## Query parameters

- `project` (`getRanking.query.project`; string, optional) — A project’s id or exact name; case is ignored. Leave it out for the project active in the app.
- `days` (`getRanking.query.days`; integer, optional) — The period in days, ending now.
  - one of `7`, `30` · default: `7`

## Code samples

### cURL

```bash
curl --request GET \
  --url https://whyviral.ai/api/v1/ranking \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://whyviral.ai/api/v1/ranking';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://whyviral.ai/api/v1/ranking"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
```

## Responses

### 200

The ranking.

#### Example

```json
{
  "object": "ranking",
  "project": {
    "id": "q17d3k9x2v8q1m4n6b0c5w7h2r9t3y8a",
    "name": "Crumbsheet"
  },
  "period": {
    "days": 7,
    "from": "2026-11-10T10:00:00.000Z",
    "to": "2026-11-17T10:00:00.000Z"
  },
  "total_mentions": 36,
  "posts_read": 1840,
  "videos_watched": 50,
  "topic_set": {
    "week": "2026-W46",
    "videos": 50,
    "watched": 50,
    "with_brand": 13,
    "topics": [
      "home bakery pricing"
    ],
    "built_at": "2026-11-16T06:20:00.000Z"
  },
  "brands": [
    {
      "id": "t17e2m8x4c9v0b3n5q7w1r6t2y8u4i0o",
      "kind": "brand",
      "name": "Crumbsheet",
      "own": true,
      "mentions": 14,
      "share": 0.39,
      "previous_share": 0.27,
      "views": 731000,
      "creators": 11,
      "by_where": {
        "said": 5,
        "shown": 3,
        "written": 6
      },
      "watch_only": 8,
      "sponsored_share": 0.14,
      "sentiments": {
        "positive": 6,
        "neutral": 5,
        "negative": 1
      },
      "change_pct": null,
      "change": 5,
      "topic_videos": {
        "said": 4,
        "shown": 2,
        "total": 5
      },
      "topic_share": 0.1
    },
    {
      "id": "t57e2m8x4c9v0b3n5q7w1r6t2y8u4i0o",
      "kind": "competitor",
      "name": "Doughly",
      "own": false,
      "mentions": 22,
      "share": 0.61,
      "previous_share": 0.73,
      "views": 1204000,
      "creators": 17,
      "by_where": {
        "said": 8,
        "shown": 4,
        "written": 10
      },
      "watch_only": 9,
      "sponsored_share": 0.32,
      "sentiments": {
        "positive": 9,
        "neutral": 8,
        "negative": 2
      },
      "change_pct": -8,
      "change": -2,
      "topic_videos": {
        "said": 6,
        "shown": 3,
        "total": 8
      },
      "topic_share": 0.16
    }
  ]
}
```

- `object` (`getRanking.response.200.object`; string, required) — `"ranking"`.
- `project` (`getRanking.response.200.project`; object, required)
  - `id` (`getRanking.response.200.project.id`; string, required) — The project’s id.
  - `name` (`getRanking.response.200.project.name`; string, required) — Its name.
- `period` (`getRanking.response.200.period`; object, required)
  - `days` (`getRanking.response.200.period.days`; integer, required)
  - `from` (`getRanking.response.200.period.from`; any of, required)
    - any of the following: `string`, `null`
  - `to` (`getRanking.response.200.period.to`; any of, required)
    - any of the following: `string`, `null`
- `total_mentions` (`getRanking.response.200.total_mentions`; integer, required) — Mentions of every listed brand found in the period: what the shares are parts of.
  - minimum: `0`
- `posts_read` (`getRanking.response.200.posts_read`; integer, required) — Posts the project’s searches read in the period.
  - minimum: `0`
- `videos_watched` (`getRanking.response.200.videos_watched`; integer, required) — Videos its watches read in the period.
  - minimum: `0`
- `topic_set` (`getRanking.response.200.topic_set`; any of, required) — `{week, videos, watched, with_brand, topics, built_at}`: the latest week’s most-viewed videos on the project’s topics, how many were watched, and how many of those name a listed brand. Null before the first weekly watch.
  - any of the following:
    - `object`
      - `week` (`getRanking.response.200.topic_set.1.week`; string, required) — The ISO week, such as `2026-W46`.
      - `videos` (`getRanking.response.200.topic_set.1.videos`; integer, required)
        - minimum: `0`
      - `watched` (`getRanking.response.200.topic_set.1.watched`; integer, required)
        - minimum: `0`
      - `with_brand` (`getRanking.response.200.topic_set.1.with_brand`; integer, required)
        - minimum: `0`
      - `topics` (`getRanking.response.200.topic_set.1.topics`; array of string, required)
      - `built_at` (`getRanking.response.200.topic_set.1.built_at`; any of, required)
        - any of the following: `string`, `null`
    - `null`
- `brands` (`getRanking.response.200.brands`; array of object, required) — The project’s own brand first, then each competitor.
  - `id` (`getRanking.response.200.brands.id`; string, required) — The tracker’s id.
  - `kind` (`getRanking.response.200.brands.kind`; string, required) — `brand` for the project’s own, else `competitor`.
    - one of `"brand"`, `"competitor"`, `"topic"`, `"hashtag"`, `"campaign_tag"`
  - `name` (`getRanking.response.200.brands.name`; string, required) — The brand’s name.
  - `own` (`getRanking.response.200.brands.own`; boolean, required) — True for the project’s own brand.
  - `mentions` (`getRanking.response.200.brands.mentions`; integer, required) — Organic and sponsored mentions found in the period.
    - minimum: `0`
  - `share` (`getRanking.response.200.brands.share`; any of, required) — Its part of `total_mentions`, 0 to 1; null when none were found.
    - any of the following: `number`, `null`
  - `previous_share` (`getRanking.response.200.brands.previous_share`; any of, required) — The same for the period before.
    - any of the following: `number`, `null`
  - `views` (`getRanking.response.200.brands.views`; integer, required) — Views on those posts.
    - minimum: `0`
  - `creators` (`getRanking.response.200.brands.creators`; integer, required) — Creators behind them.
    - minimum: `0`
  - `by_where` (`getRanking.response.200.brands.by_where`; object, required) — `{said, shown, written}`.
    - `said` (`getRanking.response.200.brands.by_where.said`; integer, required)
      - minimum: `0`
    - `shown` (`getRanking.response.200.brands.by_where.shown`; integer, required)
      - minimum: `0`
    - `written` (`getRanking.response.200.brands.by_where.written`; integer, required)
      - minimum: `0`
  - `watch_only` (`getRanking.response.200.brands.watch_only`; integer, required) — Mentions found only by watching: no search of captions returns them.
    - minimum: `0`
  - `sponsored_share` (`getRanking.response.200.brands.sponsored_share`; any of, required) — Sponsored mentions over all of them, 0 to 1; null without mentions.
    - any of the following: `number`, `null`
  - `sentiments` (`getRanking.response.200.brands.sentiments`; object, required) — `{positive, neutral, negative}`: the mentions read for it.
    - `positive` (`getRanking.response.200.brands.sentiments.positive`; integer, required)
      - minimum: `0`
    - `neutral` (`getRanking.response.200.brands.sentiments.neutral`; integer, required)
      - minimum: `0`
    - `negative` (`getRanking.response.200.brands.sentiments.negative`; integer, required)
      - minimum: `0`
  - `change_pct` (`getRanking.response.200.brands.change_pct`; any of, required) — Whole percent against the period before; null when that one had fewer than 10 mentions.
    - any of the following: `integer`, `null`
  - `change` (`getRanking.response.200.brands.change`; any of, required) — The same difference as a plain count; null when the period before had no mentions.
    - any of the following: `integer`, `null`
  - `topic_videos` (`getRanking.response.200.brands.topic_videos`; object, required) — `{said, shown, total}`: videos of `topic_set` that say or show the brand.
    - `said` (`getRanking.response.200.brands.topic_videos.said`; integer, required)
      - minimum: `0`
    - `shown` (`getRanking.response.200.brands.topic_videos.shown`; integer, required)
      - minimum: `0`
    - `total` (`getRanking.response.200.brands.topic_videos.total`; integer, required)
      - minimum: `0`
  - `topic_share` (`getRanking.response.200.brands.topic_share`; any of, required) — `topic_videos.total` over the watched videos of `topic_set`, 0 to 1.
    - any of the following: `number`, `null`

### 400

`INVALID_REQUEST`: The body isn’t JSON, its `url` is missing or too long, or a parameter has a value it doesn’t take. `INVALID_PERIOD`: `days` isn’t a period this endpoint takes; `days` in the answer lists the ones it does. `AMBIGUOUS_PROJECT`: Several of your projects share the name you sent; pass the project’s `id`.

#### Example

```json
{
  "error": {
    "code": "INVALID_REQUEST",
    "message": "The body isn’t JSON, its url is missing or too long, or a parameter has a value it doesn’t take."
  }
}
```

- `error` (`getRanking.response.400.error`; object, required) — Some codes add details, such as `cap`, `required` or `balance`.
  - `code` (`getRanking.response.400.error.code`; string, required)
    - one of `"INVALID_REQUEST"`, `"UNSUPPORTED_LINK"`, `"INVALID_PERIOD"`, `"AMBIGUOUS_PROJECT"`, `"INVALID_REPORT"`, `"CREATOR_NOT_SAVED"`, `"TOO_MANY_REPORTS"`, `"INVALID_API_KEY"`, `"INSUFFICIENT_CREDITS"`, `"ACCOUNT_DISABLED"`, `"NOT_FOUND"`, `"TRACKER_NOT_FOUND"`, `"MONTHLY_LIMIT"`, `"RATE_LIMITED"`, `"INTERNAL"`, `"SEARCH_UNAVAILABLE"`
  - `message` (`getRanking.response.400.error.message`; string, required) — What went wrong, in words.

### 401

`INVALID_API_KEY`: The key is missing, mistyped or revoked.

#### Example

```json
{
  "error": {
    "code": "INVALID_API_KEY",
    "message": "The key is missing, mistyped or revoked."
  }
}
```

- `error` (`getRanking.response.401.error`; object, required) — Some codes add details, such as `cap`, `required` or `balance`.
  - `code` (`getRanking.response.401.error.code`; string, required)
    - one of `"INVALID_REQUEST"`, `"UNSUPPORTED_LINK"`, `"INVALID_PERIOD"`, `"AMBIGUOUS_PROJECT"`, `"INVALID_REPORT"`, `"CREATOR_NOT_SAVED"`, `"TOO_MANY_REPORTS"`, `"INVALID_API_KEY"`, `"INSUFFICIENT_CREDITS"`, `"ACCOUNT_DISABLED"`, `"NOT_FOUND"`, `"TRACKER_NOT_FOUND"`, `"MONTHLY_LIMIT"`, `"RATE_LIMITED"`, `"INTERNAL"`, `"SEARCH_UNAVAILABLE"`
  - `message` (`getRanking.response.401.error.message`; string, required) — What went wrong, in words.

### 403

`ACCOUNT_DISABLED`: The key’s account is disabled.

#### Example

```json
{
  "error": {
    "code": "ACCOUNT_DISABLED",
    "message": "The key’s account is disabled."
  }
}
```

- `error` (`getRanking.response.403.error`; object, required) — Some codes add details, such as `cap`, `required` or `balance`.
  - `code` (`getRanking.response.403.error.code`; string, required)
    - one of `"INVALID_REQUEST"`, `"UNSUPPORTED_LINK"`, `"INVALID_PERIOD"`, `"AMBIGUOUS_PROJECT"`, `"INVALID_REPORT"`, `"CREATOR_NOT_SAVED"`, `"TOO_MANY_REPORTS"`, `"INVALID_API_KEY"`, `"INSUFFICIENT_CREDITS"`, `"ACCOUNT_DISABLED"`, `"NOT_FOUND"`, `"TRACKER_NOT_FOUND"`, `"MONTHLY_LIMIT"`, `"RATE_LIMITED"`, `"INTERNAL"`, `"SEARCH_UNAVAILABLE"`
  - `message` (`getRanking.response.403.error.message`; string, required) — What went wrong, in words.

### 404

`NOT_FOUND`: No read, project, creator, campaign or report like this on your account.

#### Example

```json
{
  "error": {
    "code": "NOT_FOUND",
    "message": "No read, project, creator, campaign or report like this on your account."
  }
}
```

- `error` (`getRanking.response.404.error`; object, required) — Some codes add details, such as `cap`, `required` or `balance`.
  - `code` (`getRanking.response.404.error.code`; string, required)
    - one of `"INVALID_REQUEST"`, `"UNSUPPORTED_LINK"`, `"INVALID_PERIOD"`, `"AMBIGUOUS_PROJECT"`, `"INVALID_REPORT"`, `"CREATOR_NOT_SAVED"`, `"TOO_MANY_REPORTS"`, `"INVALID_API_KEY"`, `"INSUFFICIENT_CREDITS"`, `"ACCOUNT_DISABLED"`, `"NOT_FOUND"`, `"TRACKER_NOT_FOUND"`, `"MONTHLY_LIMIT"`, `"RATE_LIMITED"`, `"INTERNAL"`, `"SEARCH_UNAVAILABLE"`
  - `message` (`getRanking.response.404.error.message`; string, required) — What went wrong, in words.

### 429

`RATE_LIMITED`: Too many new reads, data requests, searches or report links; wait the `Retry-After` header’s seconds.

#### Example

```json
{
  "error": {
    "code": "RATE_LIMITED",
    "message": "Too many new reads, data requests, searches or report links; wait the Retry-After header’s seconds."
  }
}
```

- `error` (`getRanking.response.429.error`; object, required) — Some codes add details, such as `cap`, `required` or `balance`.
  - `code` (`getRanking.response.429.error.code`; string, required)
    - one of `"INVALID_REQUEST"`, `"UNSUPPORTED_LINK"`, `"INVALID_PERIOD"`, `"AMBIGUOUS_PROJECT"`, `"INVALID_REPORT"`, `"CREATOR_NOT_SAVED"`, `"TOO_MANY_REPORTS"`, `"INVALID_API_KEY"`, `"INSUFFICIENT_CREDITS"`, `"ACCOUNT_DISABLED"`, `"NOT_FOUND"`, `"TRACKER_NOT_FOUND"`, `"MONTHLY_LIMIT"`, `"RATE_LIMITED"`, `"INTERNAL"`, `"SEARCH_UNAVAILABLE"`
  - `message` (`getRanking.response.429.error.message`; string, required) — What went wrong, in words.

### 500

`INTERNAL`: Something broke on our side; try again.

#### Example

```json
{
  "error": {
    "code": "INTERNAL",
    "message": "Something broke on our side; try again."
  }
}
```

- `error` (`getRanking.response.500.error`; object, required) — Some codes add details, such as `cap`, `required` or `balance`.
  - `code` (`getRanking.response.500.error.code`; string, required)
    - one of `"INVALID_REQUEST"`, `"UNSUPPORTED_LINK"`, `"INVALID_PERIOD"`, `"AMBIGUOUS_PROJECT"`, `"INVALID_REPORT"`, `"CREATOR_NOT_SAVED"`, `"TOO_MANY_REPORTS"`, `"INVALID_API_KEY"`, `"INSUFFICIENT_CREDITS"`, `"ACCOUNT_DISABLED"`, `"NOT_FOUND"`, `"TRACKER_NOT_FOUND"`, `"MONTHLY_LIMIT"`, `"RATE_LIMITED"`, `"INTERNAL"`, `"SEARCH_UNAVAILABLE"`
  - `message` (`getRanking.response.500.error.message`; string, required) — What went wrong, in words.


Source: https://api.whyviral.ai/api/ranking/retrieve/index.md
