# List market types

> The market rules, keyed by rule, and the event types each runs on.

Source: https://docs.stxapp.io/apps/api/list-market-types/

> **Availability.** Available on US demo now. See [Environments](https://docs.stxapp.io/environments/).

The market rules, keyed by rule, and the event types each runs on. A rule with `partner_create: true` can be created with `POST /api/v1/markets`, and lists the `fields` an entry takes and, per event type, its `sport` and the `stats` on offer. Changes only when STX adds a rule or a stat, so read it once and cache it.

```http
GET /api/v1/types
```

Send it with your own demo key: [Try it](/quick-start/?op=types_get#try-it).

:::note[For apps]
Call it with an OAuth app token (`client_credentials`) carrying `events`. See [Creating markets](/apps/creating-markets/).
:::

:::tip[In the SDKs]
- TypeScript: [`STX.marketTypes()`](/sdks/typescript/reference/stx/#markettypes)
- Python: [`STX.market_types()`](/sdks/python/reference/stx/#market_types)
- C#: [`STXClient.GetMarketTypesAsync()`](/sdks/csharp/reference/stx-client/#markets-and-events)
:::

## Responses

| Status | Description | Schema |
|---|---|---|
| `200` | Success | object |
| `401` | No credential, a bad signature or an invalid OAuth access token. Body: &#123;"error":"Missing or invalid API key credentials"&#125;, or for an OAuth token &#123;"error":"Missing or invalid OAuth access token"&#125;. | Error |
| `403` | An OAuth app token without the `events` scope. The account behind this key is not active, for example it is pending approval or suspended. Body: &#123;"error":"Your account is suspended. Contact support."&#125;, the message naming the account's status. | Error |

## Example

Request:

```bash
curl --request GET \
  --url 'https://demo.stxapp.io/api/v1/types' \
  --header 'Authorization: Bearer <app-access-token>'
```

Response `200`:

```json
{
  "home_winner": {
    "event_types": [
      "baseball_game",
      "basketball_game",
      "cricket_match",
      "football_game",
      "hockey_game",
      "soccer_game"
    ],
    "partner_create": false
  },
  "over_under": {
    "event_types": [
      "baseball_game",
      "basketball_game",
      "cricket_match",
      "football_game",
      "hockey_game",
      "soccer_game",
      "tennis_match"
    ],
    "partner_create": false
  },
  "player_stat_line": {
    "event_types": {
      "hockey_game": {
        "sport": "Hockey",
        "stats": [
          {
            "name": "Total Assists",
            "stat": "ASSISTS"
          },
          {
            "name": "Goals",
            "stat": "GOALS"
          },
          {
            "name": "Shots on Goal",
            "stat": "GOAL_SO"
          },
          {
            "name": "Total Points",
            "stat": "POINTS"
          },
          {
            "name": "Total Saves",
            "stat": "SAVES"
          }
        ]
      }
    },
    "fields": {
      "line": {
        "description": "A positive half line, e.g. 19.5.",
        "type": "number"
      },
      "player_id": {
        "description": "A player_id from GET /api/v1/events/{event_id}/players.",
        "type": "string"
      },
      "stat": {
        "description": "One of the event type's stats.",
        "type": "string"
      }
    },
    "partner_create": true
  }
}
```

### Response fields

**`player_stat_line`**: Player stat lines: over/under a player's stat.

| Field | Type | Description |
|---|---|---|
| `event_types` | object | The event types it runs on, keyed by event type. |
| `fields` | object | What an entry takes besides `rule`. |
| `partner_create` | boolean | Always `true`: `POST /api/v1/markets` creates them. |

**Every other key**: A rule that cannot be created through the API.

| Field | Type | Description |
|---|---|---|
| `event_types` | array | The event types it runs on. |
| `partner_create` | boolean | Always `false`. |
