# GET /stats - List All Stats
URL: https://sockodds.com/docs/endpoints/getStats/

# GET /stats - List All Stats [#get-stats---list-all-stats]

Get a list of StatIDs

`GET https://api.sockodds.com/v2/stats/`

Retrieve all supported statistics with statID values. Filter by sportID and by the level (all, team, player) the stat is priced at.

## Query parameters [#query-parameters]

| Parameter | Type | Description |
| --- | --- | --- |
| `statID` | `string` | StatID to get data for |
| `sportID` | `string` | SportID to get StatIDs for |
| `statLevel` | `string` | Level of the stat, must be used in combination with sportID. Must be one of all, player, or team. Shows stats that are applicable to that specified entity, defaults to all. |

## Response [#response]

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

### Stat [#stat]

Contains information on a statistic (statID)

| Field | Type | Description |
| --- | --- | --- |
| `statID` | `string` |  |
| `supportedLevels` | `object` | { all, team, player } — which statEntityID classes it is priced at |
| `displays` | `object` | { short, long } |
| `isScoreStat` | `boolean` | True for `points`, the stat that decides the event |
| `supportedSports` | `object` | sportID → true |

### Status codes [#status-codes]

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

## Code samples [#code-samples]

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

```bash
curl -X GET "https://api.sockodds.com/v2/stats/?sportID=CRICKET" \
  -H "x-api-key: YOUR_API_KEY"
```

```javascript
const r = await fetch("https://api.sockodds.com/v2/stats/?sportID=CRICKET", { 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/stats/", params=dict(sportID="CRICKET"), headers={"x-api-key": "YOUR_API_KEY"})
body = r.json()
```

```go
req, _ := http.NewRequest("GET", "https://api.sockodds.com/v2/stats/?sportID=CRICKET", 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/stats/?sportID=CRICKET"))
    .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/stats/?sportID=CRICKET");
```

## Try it [#try-it]

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