# GET /account/usage - Check API Usage and Limits
URL: https://sockodds.com/docs/endpoints/getUsageData/

# GET /account/usage - Check API Usage and Limits [#get-accountusage---check-api-usage-and-limits]

Get rate-limits and usage data about your API key

`GET https://api.sockodds.com/v2/account/usage`

Check your API key's tier, rate limits and current usage by interval. Calling it counts as a request like any other.

## Query parameters [#query-parameters]

No query parameters. Authentication only.

## Response [#response]

`{ "success": true, "data": AccountUsage[], "nextCursor": string | null }`

### AccountUsage [#accountusage]

Your API key's tier, rate limits and current usage

| Field | Type | Description |
| --- | --- | --- |
| `keyID` | `string` | The hashed identifier for the API key (the first 16 hex of sha256) |
| `customerID` | `string \| null` | Billing customer id where one exists |
| `email` | `string \| null` |  |
| `isActive` | `boolean` |  |
| `tier` | `string` | lite, base or internal |
| `rateLimits` | `object` | per-second / per-minute / per-hour / per-day / per-month → RateLimitInterval |

### Status codes [#status-codes]

| Status | Body |
| --- | --- |
| `200` | `Success` |
| `401` | `{"success":false,"error":"Invalid API key"}` |
| `403` | `{"success":false,"error":"Inactive API key"}` |
| `404` | `{"success":false,"error":"Not found"}` |
| `429` | `{"success":false,"error":"Rate limit exceeded"} (Retry-After header)` |

### Example response [#example-response]

```json
{
  "success": true,
  "data": [
    {
      "keyID": "5fb8c85833e6dcf5",
      "customerID": null,
      "email": "you@example.com",
      "isActive": true,
      "tier": "base",
      "rateLimits": {
        "per-second": {
          "max-requests": null,
          "current-requests": null,
          "max-entities": null,
          "current-entities": null
        },
        "per-minute": {
          "max-requests": 60,
          "current-requests": 3,
          "max-entities": null,
          "current-entities": null
        },
        "per-hour": {
          "max-requests": null,
          "current-requests": null,
          "max-entities": null,
          "current-entities": null
        },
        "per-day": {
          "max-requests": null,
          "current-requests": 412,
          "max-entities": null,
          "current-entities": 2210
        },
        "per-month": {
          "max-requests": null,
          "current-requests": null,
          "max-entities": null,
          "current-entities": null
        }
      }
    }
  ]
}
```

## Code samples [#code-samples]

**cURL** · **JavaScript** · **Python** · **Go** · **Java** · **C#**

```bash
curl -X GET "https://api.sockodds.com/v2/account/usage" \
  -H "x-api-key: YOUR_API_KEY"
```

```javascript
const r = await fetch("https://api.sockodds.com/v2/account/usage", { headers: { "x-api-key": "YOUR_API_KEY" } });
const { success, data, nextCursor, notice } = await r.json();
```

```python
import requests
r = requests.get("https://api.sockodds.com/v2/account/usage", params={}, headers={"x-api-key": "YOUR_API_KEY"})
body = r.json()
```

```go
req, _ := http.NewRequest("GET", "https://api.sockodds.com/v2/account/usage", nil)
req.Header.Set("x-api-key", "YOUR_API_KEY")
res, err := http.DefaultClient.Do(req)
```

```java
HttpRequest req = HttpRequest.newBuilder().uri(URI.create("https://api.sockodds.com/v2/account/usage"))
    .header("x-api-key", "YOUR_API_KEY").GET().build();
HttpResponse<String> res = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString());
```

```csharp
using var http = new HttpClient();
http.DefaultRequestHeaders.Add("x-api-key", "YOUR_API_KEY");
var body = await http.GetStringAsync("https://api.sockodds.com/v2/account/usage");
```

## Try it [#try-it]

> Need help?[FAQ](https://sockodds.com/docs/faq/) · [Email](mailto:api@sockodds.com) · [Contact](https://sockodds.com/contact-us/)
