---
id: video-streaming
title: Video Streaming in Sport Line API
description: Instructions for detecting and retrieving available sports match video streams through Sport Line API.
version: v1
language: en
---

# Video Streaming in Sport Line API

## What Sport Line API Provides

Sport Line API indicates whether video streaming is available for a specific Live match
and returns its identifier.

Two fields are used:

| Field | Type | Purpose |
|---|---|---|
| `va` | number or `null` | Video availability indicator: `1` means a stream is available; `null` means no stream is available |
| `vi` | string or `null` | Live match video stream ID |

The value `va: 0` is not used.

## Coverage Restriction

SportAPI does not stream matches from top sports leagues. Video streams are available
only for some other competitions.

Do not promise video availability for a specific tournament, country, sport, or Live
match in advance. Determine availability separately for each match using `va` and `vi`
from the current sports line response.

The `topmatches` method name also does not mean that SportAPI streams top leagues. It is
the name of a separate match selection in the API, not a description of the tournament
level.

## When Video Is Available

In verified responses, an available stream has both fields populated:

```json
{
  "va": 1,
  "vi": "20064614"
}
```

When no stream is available, the fields are returned as:

```json
{
  "va": null,
  "vi": null
}
```

Client logic must check both fields:

| `va` | `vi` | Action |
|---|---|---|
| `1` | non-empty string | The stream is marked as available; pass `vi` to the connected video component |
| `null` | `null` | Do not show the video button or video section |
| any other combination | any value | Do not start video automatically; treat the response as inconsistent and refresh the data |

Do not store the presence of `vi` as a permanent match property. Check availability in
the current Live response.

## `vi` Format

`vi` is a string identifier, not a number or a ready-to-use URL.

Actual responses contained different formats:

```json
{
  "vi": "20064614"
}
```

```json
{
  "vi": "DR_3_1783061985"
}
```

Even when the string contains only digits, do not convert it to a numeric type. Store
and pass `vi` exactly as received from Sport Line API.

`vi` is not a ready-made `iframe` or video-stream URL. It is an ID passed to the
ready-made video widget.

## Ready-made Video Widget and `iframe`

The video stream is embedded in the website as a separate ready-made widget through an
`iframe`. The client does not need to obtain the stream independently or develop a
video player.

```text
Sport Line API → va and vi → ready-made video widget → iframe on the client's website
```

The widget receives `vi` as the ID of the selected stream. Do not use `vi` itself as the
complete `iframe` `src`: the widget address and other integration parameters are
specified in the separate video-streaming service guide.

This document describes only the relationship between the video widget and Sport Line
API. The complete video embedding guide for `iframe` will be provided separately.

## Where Video Fields Are Returned

`va` and `vi` are part of the match object. They can be retrieved with a Live match, for
example through:

- [`events`](../api-reference/events.md) — the Live match list;
- [`event`](../api-reference/event.md) — a specific Live match;
- `topmatches` — the fields are present in both short and extended Live match summaries.

Video is not yet available in Prematch. The fields may technically be present as
`null`, but this does not indicate video availability.

## Example from a Live Match List

```json
{
  "game_id": 746049368,
  "sport_id": 1,
  "tournament_name": "Russia. Youth Championship. Division A",
  "opp_1_name": "Akron-Yuri Konoplyov Academy (Youth)",
  "opp_2_name": "Zenit Saint Petersburg (Youth)",
  "va": 1,
  "vi": "20064614"
}
```

`game_id` and `vi` serve different purposes:

- `game_id` is used to request match data through `event`;
- `vi` identifies the video stream in the separate video service.

Do not substitute `game_id` for `vi`.

## Interface Behavior

Recommended logic for a Live match card:

1. Check `va` and `vi`.
2. If `va: 1` and `vi` is populated, show a “Watch Stream” button or video section.
3. If `va: null` or `vi: null`, do not show an unavailable video player.
4. Check both fields again after every match update.
5. If the stream disappears from the response, disable the button and stop using the
   stored `vi`.

Sport Line API does not define the appearance of the video player. Video is displayed
by a separate ready-made widget embedded through an `iframe`.

## Important Considerations

- Video is available only for Live matches.
- Not every Live match has a stream.
- SportAPI does not stream matches from top leagues.
- `va` can only be `1` or `null`.
- Always process `vi` as a string or `null`.
- `vi` is an ID, not a video-stream URL.
- Check availability after every match-object update.

## Practical Integration Rules

1. Show video only when `va: 1` and `vi` is populated.
2. Pass `vi` without converting or modifying it.
3. Do not use `game_id` or other fields in place of `vi`.
4. Do not promise video for a particular league or match before checking the Live
   response.
5. If `vi` disappears, stop showing the stream as available.
6. Use the ready-made video widget embedded through an `iframe`.

## Related Documents

- [Match Data Model](../data-models/match.md)
- [`events` — Match List](../api-reference/events.md)
- [`event` — Specific Match](../api-reference/event.md)
- [Field Reference](../data-models/field-reference.md)
