> ## Documentation Index
> Fetch the complete documentation index at: https://docs.magicmarkets.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sports and bet types

> Sport codes, the bet type grammar, handicap line scaling, period tokens, tennis, multirunner events, and validation.

Every betslip, order and bet carries a `sport` and a `bet_type`. They are short strings with a grammar. You rarely need the grammar: **read `bet_type` off an offer and pass it through verbatim.** This page is the reference for when you need to understand or validate one. For the sports and markets in plain language, see [Sports and markets](/platform/sports-and-markets).

## Sport codes

`sport` is a lowercase string. These are the codes in use. See [Sports and markets](/platform/sports-and-markets) for what is listed.

| Code | Sport |
| - | - |
| `fb` | Football, full 90 minutes |
| `fb_ht` | Football, first half |
| `fb_2h` | Football, second half |
| `fb_et` | Football, extra time |
| `fb_corn` | Football corners, 90 minutes |
| `fb_corn_ht` | Football corners, first half |
| `fb_book` | Football yellow cards, 90 minutes |
| `fb_htft` | Football combined half-time and full-time result |
| `basket` | Basketball, full match |
| `basket_ht`, `basket_2h` | Basketball halves |
| `basket_q1` to `basket_q4` | Basketball quarters |
| `tennis` | Tennis |
| `ih` | Ice hockey |
| `af` | American football |
| `rl`, `ru` | Rugby league, rugby union |
| `arf` | Australian rules football |
| `hand` | Handball |
| `volley` | Volleyball |
| `baseball` | Baseball |
| `cricket` | Cricket |
| `darts` | Darts |
| `boxing` | Boxing |
| `mma` | Mixed martial arts |
| `golf` | Golf |
| `cycling` | Cycling |
| `moto` | Motorsport |
| `esports` | Esports |
| `politics` | Political markets |
| `specials` | Specials and novelty markets |

On combo betslips and orders, `sport` is the literal string `parlay` and the per-leg sport sits inside each `legs[]` entry. The app calls these combos. See [Combos](/traders/trading/combos) for how a combo is priced and settled.

<Note>
  Treat this table as informational, not as a closed enum. New sports are added. Do not hard-fail on an unknown code.
</Note>

## Bet type grammar

`bet_type` is a comma-separated string. The first token is the direction:

* `for`: back the outcome. You win if it happens.
* `against`: take the other side. You win if the outcome does not happen. On a normal betslip, the price is odds on the outcome not happening.

The remaining tokens identify the market and its parameters. **Handicap lines are always stated from the home team's side**, even when the selection is the away team: `for,ah,a,-4` is away +1.0.

### Asian handicap lines are 4 x the real line

Lines travel as integers equal to four times the actual line, so quarter-goal lines stay integer on the wire:

| Wire integer | Real line |
| - | - |
| `0` | 0.0 |
| `2` | 0.5 |
| `7` | 1.75 |
| `8` | 2.0 |
| `-4` | -1.0 |
| `-21` | -5.25 |

### Match result

| Bet type | Meaning |
| - | - |
| `for,h` / `for,d` / `for,a` | Home, draw, away |
| `for,sd` | Score draw |
| `for,win_90,h` | Home wins in 90 minutes |
| `for,dnb,h` | Home win, void if draw |
| `for,hnb,a` / `for,anb,h` | Home no bet, away no bet |
| `for,ml,h` | Moneyline, draw void |
| `for,dc,h,d` | Double chance, home or draw |
| `for,uswin,h` | US-style home win |
| `for,awdw,h` | Asian win, draw, win |
| `for,qualify,h` | Home to qualify |

### Totals

| Bet type | Meaning |
| - | - |
| `for,over,2.5` / `for,under,2.5` | Over or under a non-integer line |
| `for,overeq,3` / `for,undereq,3` | Over or under an integer line, inclusive |
| `for,exact_total,3` | Exactly 3 goals |
| `for,exact_total,3,inf` | 3 or more |
| `for,gr,1,3` | Goal range 1 to 3 inclusive |
| `for,teamgr,h,0,2` | Home scores 0 to 2 |
| `for,odd` / `for,even` | Total odd or even |
| `for,odd,h` / `for,even,a` | Per-team odd or even |

### Handicaps

| Bet type | Meaning |
| - | - |
| `for,ah,h,-4` | Asian handicap, home -1.0 |
| `for,ahover,7` / `for,ahunder,7` | Asian over or under 1.75 |
| `for,tahover,h,2` / `for,tahunder,a,2` | Team Asian over or under 0.5 |
| `for,eh,h,1` | English handicap, home +1 |

### Correct score and margins

| Bet type | Meaning |
| - | - |
| `for,cs,2,1` | Correct score 2-1 |
| `for,othercs,3,3` | Any score outside home 3 or fewer and away 3 or fewer |
| `for,wm,h,2,2` | Home wins by exactly 2 |
| `for,wm,h,2,inf` | Home wins by 2 or more |
| `for,wmo,h,1,2.5` | Home wins by 1 and over 2.5 goals |
| `for,awm,1` | Absolute margin 1, either side |
| `for,wg,h,2` | Home wins and scores at least 2 |
| `for,quatro,h,o,2.5` | Home wins and over 2.5 goals |
| `for,moou,h,over,2.5` | Match result plus over or under |
| `for,mo_both_score,h,yes` | Home wins and both teams score |

### Scoring and clean sheets

| Bet type | Meaning |
| - | - |
| `for,score,both,yes` / `for,score,both,no` | Both teams score, or not |
| `for,score,either` / `for,score,neither` / `for,score,one` | Scoring patterns |
| `for,score,h,yes` / `for,score,h,no` | Home scores, or not |
| `for,clean,h` | Home clean sheet |
| `for,clean,both` / `for,clean,either` / `for,clean,neither` / `for,clean,one` | Clean sheet patterns |
| `for,fg,no_goal` | No goals |

## Tennis

Tennis bet types carry a period and a void rule:

```
for,tset,<period>,<void_rule>,<unit>[,<market>,<args>...]
```

* `<period>`: `1` to `5` for a set, or `all` for the match.
* `<void_rule>`: `vwhole`, `vsetN` or `vgameN`, meaning when the bet voids if a player retires.
* `<unit>`: `set` or `game`, optionally followed by a market and its arguments.

Examples: `for,tset,all,vset1,p1` backs player 1 to win the match, voiding unless set 1 completes. `for,tset,1,vwhole,p1` backs player 1 to win set 1. `for,tset,all,vwhole,game,ahover,62` backs total games over 15.5.

## Periods in other sports

| Token | Meaning |
| - | - |
| `tp,<period>` | Generic period: `all`, `reg`, or `1` to `9` |
| `tperiod,<n>` | A specific period, as in ice hockey or handball |
| `thalf,<n>` | First or second half |
| `tquarter,<n>` | A quarter, as in basketball or the NFL |
| `tinnings,<n>` | An inning, or `all` |
| `tmap,<n>` | A map in esports, `1` to `5` |

The token is followed by an optional `sub,<subsport>` modifier and then the market:

```
for,<period_token>[,sub,<subsport>],<market>[,<args>...]
```

Examples: `for,thalf,1,ah,h,0` is the first-half Asian handicap at 0.0. `for,tquarter,2,wdw,h` is home to win the second quarter. `for,tmap,1,ahover,42` is esports total kills on map 1 over 10.5. `for,tp,all,sub,180,ahover,8` is darts, over 2.0 180s.

The legacy aliases `tall`, `treg`, `tp1`, `tp2` and so on are no longer accepted. Use the tokens above.

## Multirunner events

For events with many runners, such as golf or outright winners:

* `for,win,<team_id>`: the runner to win outright.
* `for,top,<n>,<team_id>`: the runner to finish in the top `<n>`.

## Validating a bet type

```bash theme={"dark"}
curl "https://magicmarkets.com/v2/sports/fb/bet_types/for,ah,h,-4/" \
  -H "X-Api-Key: $MAGICMARKETS_API_KEY"
```

A `200` includes a human-readable `bet_type_description` and the win and loss payoff grid. A `400` means the string did not parse. This endpoint uses `code: "invalid_bet_type"` with the rejected string in `data.bet_type`, not the usual `validation_error` shape. It cannot validate multirunner bet types, because they need an event context, and always returns the `400` for them.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.