---
title: "Get the account"
---

> 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 account

Path: WhyViral API › Account

`GET /account`

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

Your credit balance, the credits that expire next, and the calling key’s price per read, monthly limit and this month’s use. Free.

## Authentication

Requires one of the following:

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

## Code samples

### cURL

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

### TypeScript

```typescript
const url = 'https://whyviral.ai/api/v1/account';
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/account"

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

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

print(response.text)
```

## Responses

### 200

The account.

#### Example

```json
{
  "object": "account",
  "credits": 1240,
  "next_expiry": {
    "credits": 500,
    "expires_at": "2027-01-12T00:00:00.000Z"
  },
  "key": {
    "id": "k17e2m8x4c9v0b3n5q7w1r6t2y8u4i0o",
    "credits_per_read": 20,
    "monthly_reads": 1000,
    "this_month": {
      "reads": 12,
      "credits": 240
    }
  }
}
```

- `object` (`getAccount.response.200.object`; string, required)
- `credits` (`getAccount.response.200.credits`; integer, required) — Your credit balance.
  - minimum: `0`
- `next_expiry` (`getAccount.response.200.next_expiry`; any of, required)
  - any of the following:
    - `object`
      - `credits` (`getAccount.response.200.next_expiry.1.credits`; integer, required)
      - `expires_at` (`getAccount.response.200.next_expiry.1.expires_at`; string, required)
        - format: `date-time`
    - `null`
- `key` (`getAccount.response.200.key`; object, required) — The calling key.
  - `id` (`getAccount.response.200.key.id`; string, required) — The calling key’s id.
  - `credits_per_read` (`getAccount.response.200.key.credits_per_read`; integer, required) — What one read costs this key.
    - minimum: `0`
  - `monthly_reads` (`getAccount.response.200.key.monthly_reads`; any of, required)
    - any of the following:
      - `integer` — The key’s monthly limit, or null when its owner set none.
      - `null`
  - `this_month` (`getAccount.response.200.key.this_month`; object, required) — Reads and credits this calendar month, in UTC.
    - `reads` (`getAccount.response.200.key.this_month.reads`; integer, required)
    - `credits` (`getAccount.response.200.key.this_month.credits`; integer, required)

### 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` (`getAccount.response.401.error`; object, required) — Some codes add details, such as `cap`, `required` or `balance`.
  - `code` (`getAccount.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` (`getAccount.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` (`getAccount.response.403.error`; object, required) — Some codes add details, such as `cap`, `required` or `balance`.
  - `code` (`getAccount.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` (`getAccount.response.403.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` (`getAccount.response.500.error`; object, required) — Some codes add details, such as `cap`, `required` or `balance`.
  - `code` (`getAccount.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` (`getAccount.response.500.error.message`; string, required) — What went wrong, in words.


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