# Virtual Sports

Virtual sports offer pre-match, in-play (live), and outright betting markets. Sports covered include:

* Virtual Football League Mode (VFLM)
* Virtual Football World Cup (VFWC)
* Virtual Football Nations Cup (VFNC)
* Virtual Football Asian Cup (VFAS)
* Virtual Football Champions Cup (VFCC)
* Virtual Football Bundesliga (VFB)
* Virtual World Match Football (VWMF)
* Virtual Basketball League (VBL)
* Virtual Dog Racing – Kiron (VDK)
* Virtual Horse Racing – Kiron (VHK)
* Sim-Play Tennis (VTI)
* Sim-Play ATP Legends
* Sim-Play Baseball (VBI)
* Sim-Play Cricket (VCI)

**Pre-match Gaming**&#x20;

Due to the nature of virtual sports, matches are played more rapidly; meaning a full season lasts only a few hours. Although some markets are labeled as “pre-match,” odds are updated at a speed similar to live betting markets.

**Sim-Play Gaming**&#x20;

Offers full-length virtual games that feel like real sports events. They include live markets, with real-time betting opportunities as the game happens.&#x20;

### Virtual Sport Producers

Each Virtual Sport is exposed as a separate producer in Unified Odds Feed.  See the list of [virtual sport producers](https://docs.sportradar.com/uof/introduction/key-concepts/producers)&#x20;

### Sport entities URNs

Sports entities that belong to Virtual Sports (seasons, matches, stages, etc.) use specific URN prefixes, so they can be easily identified.

Virtual Football prefix is **"vf**" e.g. **vf:match:xxxx**

Other prefixes are:

* Virtual Basketball League: "vbl"
* Virtual Dog Racing: "vdr"
* Virtual Horse Classics: "vhc"
* Sim-Play Cricket: "vci"
* Sim-Play Tennis & Sim-Play ATP Legends: "vti"
* Sim-Play Baseball: "vbi"

### Access Tokens

To access all feeds clients need to provide a valid access token. For the Recovery and SportsAPI use a header key: x-access-token with the token as value. For the XML-Feed use the token as username.

| **Feed/API/Component**   | **Staging**                                                                                                                                                          | **Production**                                                                                                                                                 |
| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| UOF XML-Feed (Rabbit MQ) | <p>Host (SSL): <a href="http://stgmq.betradar.com/">stgmq.betradar.com</a></p><p>Port: 5671</p>                                                                      | <p>Host (SSL): <a href="http://mq.betradar.com/">mq.betradar.com</a></p><p>Port: 5671</p>                                                                      |
| UOF Recovery             | <p><a href="https://stgapi.betradar.com/v1/%7Bproduct%7D/%7Bendpoint"><https://stgapi.betradar.com/v1/{product}/{endpoint></a>}</p><p>(Port: 80)</p>                 | <p><a href="https://api.betradar.com/v1/%7Bproduct%7D/%7Bendpoint"><https://api.betradar.com/v1/{product}/{endpoint></a>}</p><p>(Port: 80)</p>                 |
| UF SportsAPI             | <p><a href="https://stgapi.betradar.com/v1/sports/%7Blanguage%7D/%7Bendpoint"><https://stgapi.betradar.com/v1/sports/{language}/{endpoint></a>}</p><p>(Port: 80)</p> | <p><a href="https://api.betradar.com/v1/sports/%7Blanguage%7D/%7Bendpoint"><https://api.betradar.com/v1/sports/{language}/{endpoint></a>}</p><p>(Port: 80)</p> |

### API for Virtual Sport Information

Virtual sports have their own URN type `vf:match:xxxx`, `vf:season:xxx`\`and `vf:tournament:xxxx` to retrieve virtual sport information form the API endpoints. The actual details of the matches/events are available for end-users in the front-end interfaces, and the *bet\_settlement* message includes the result.

The season information is important and this is looked up using the standard endpoints: `tournaments/(season-id)/info.xml and tournaments/(season-id)/schedule.xml` and follows the same format as real sports. The SDK automatically takes care of this, so if you are an SDK user you don’t have to worry.

Schedule for a Season

Because of fast bet cycles, Sports API endpoint for getting schedules for a specific date (or methods ***getCompetitionsFor on SportsInfoManager interface*** in Java and ***GetSportEventsByDateAsync on SportDataProvider interface*** in .NET) do not include virtual seasons and matches. Schedule for a season needs to be obtained per season directly.&#x20;

Instead of informing about the upcoming seasons and matches on the API, virtual producers send a fixture\_change information for every upcoming season.

To ensure that the client has the schedule for the upcoming season and can cache the information about the matches that will be played, the producer sends out a *fixture\_change* message with the season as the event, when a new season starts.&#x20;

The recommended behavior when receiving such a fixture change is retrieve the season schedule through API using the endpoint `tournaments/(season-id)/schedule`. The SDK handles this automatically, but if you want to do something extra on your end when a new virtual season starts, you could it so a good time to do that is when you receive the fixture change on a virtual season.

### Markets for Virtual Sports

The Unified Odds Feed uses a unified list of markets for all producers which is the same for virtual sports. (e.g. 1x2 market has ID 1 for all producers).

### Outrights for Virtual sports

There are a few structured outrights markets provided. An outright is seen as a market and the event is typically the season for the league/tournament or the race tournament.

Please note that outrights for virtual sports is optional and are activated only on request. Also, if you haven’t yet implemented outrights, you may have to make some updates to handle outrights.

Outrights may have competitor outcomes. Here each outcome is a competitor-id. Competitor outcomes are not seen for non-outright-markets.

Virtual Sports has some multi-competitor-outcome rights: like “*Who will be the top-3 in the league*”. This is a special type of market where each outcome is a comma separated list of competitor-ids.&#x20;

Sportradar intends to use the same structured format for multi-competitor-outcomes for real sport outrights going forward too, but they are not offered this way currently. You may have to update your code to handle these multi-competitor-outcomes properly.

### Endpoints supported with Virtual Sports IDs

The Unified Feed (UF) SportsAPI is used by clients (via SDK) to fetch Virtual Sports meta data. That is, data that is not directly odds related, e.g. info about matches, seasons, tournaments.

At Virtual Sports we use the same endpoints and same domain names as the common Sportradar UF SportsAPI. However, at Virtual Sports we have our own implementation of some of these endpoints, and we only support these endpoints when using Virtual Sports IDs.

To be able to access the API you need an access token. See[ Access tokens](https://docs.sportradar.com/uof/uof-guides/how-to-guides/how-to-generate-access-tokens).

| Endpoint                                                                        | URN type                                                                | Example URL production                                                                                                                                                                                                                                                                                       | Comments                                                                                                                                           |
| ------------------------------------------------------------------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| sports/{language}/sport\_events/{urn\_prefix}:{urn\_type}:{urn\_id}/fixture.xml | <ul><li>Match</li><li>Season</li><li>Tournament</li><li>Stage</li></ul> | <p><a href="https://api.betradar.com/v1"><em><https://api.betradar.com/v1></em></a><em>/sports/en/sport\_events/vf:match:12345/fixture.xml</em></p><p><br></p>                                                                                                                                               | If URN-type season or tournament are used then the response is exactly the same as calling the endpoint 'info' with the same season/tournament ID. |
| sports/{language}/sport\_events/{urn\_prefix}:{urn\_type}:{urn\_id}/summary.xml | <ul><li>Match</li><li>Season</li><li>Tournament</li><li>Stage</li></ul> | <p><a href="https://api.betradar.com/v1"><em><https://api.betradar.com/v1></em></a><em>/sports/en/sport\_events/vbl:match:12345/summary.xml</em></p><p><a href="https://api.betradar.com/v1"><em><https://api.betradar.com/v1></em></a><em>/sports/en/sport\_events/vf:tournament:12345/summary.xml</em></p> | If URN-type season or tournament are used then the response is exactly the same as calling the endpoint 'info' with the same season/tournament ID. |
| sports/{language}/tournaments/{urn\_prefix}:{urn\_type}:{urn\_id}/info.xml      | <ul><li>Season</li><li>Tournament</li><li>Stage</li></ul>               | <p><a href="https://api.betradar.com/v1"><em><https://api.betradar.com/v1></em></a><em>/sports/en/tournaments/vf:season:12345/info.xml</em></p><p><br></p>                                                                                                                                                   | Tournaments are always unique tournaments. If tournament type is used then the season in the response will be the current season.                  |
| sports/{language}/tournaments/{urn\_prefix}:{urn\_type}:{urn\_id}/schedule.xml  | <ul><li>Season</li><li>Tournament</li><li>Stage</li></ul>               | [*https://api.betradar.com/v1*](https://api.betradar.com/v1)*/sports/en/tournaments/vf:tournament:12345/schedule.xml*                                                                                                                                                                                        | Tournaments are always unique tournaments. If tournament type is used then the season in the response will be the current season.                  |

### UOF Recovery

As stated above each virtual sport is a separate producer, which means recovery needs to be done for each producer individually. This is handled automatically if you use the SDK. Also, failure handling must be considered about what happens when one of the virtual sports becomes unavailable

UOF Recovery requests for Virtual Sports are made using URLs for the different endpoints specified in the table below. An 'accepted' response is given (immediately) through HTTPS and the actual messages are sent through the UOF XML-Feed (Rabbit MQ).

Recovery request should be made using the HTTP POST method, further documentation can be found in the general documentation of Unified Feed endpoints <https://iodocs.betradar.com/unifiedfeed>

| Recovery request     | Endpoint URL                                                              | Example URL production                                                                      |
| -------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| Odds (after)         | <p>/odds/initiate\_request</p><p>(With after parameter)</p>               | <https://api.betradar.com/v1/vf/odds/initiate_request&after=>1462973515000                  |
| Odds (full)          | /odds/initiate\_request                                                   | <https://api.betradar.com/v1/vf/odds/initiate_request>                                      |
| Odds sport event     | /odds/events/{event}/initiate\_request                                    | <https://api.betradar.com/v1/vf/odds/events/vf:match:1234567/initiate_request>              |
| Stateful (after)     | <p>/stateful\_messages/initiate\_request</p><p>(With after parameter)</p> | <https://api.betradar.com/v1/vf/stateful_messages/initiate_request>\&after=1462973515000    |
| Stateful (full)      | /stateful\_messages/initiate\_request                                     | <https://api.betradar.com/v1/vf/stateful_messages/initiate_request>                         |
| Stateful sport event | /stateful\_messages/events/{event}/initiate\_request                      | <https://api.betradar.com/v1/vf/stateful_messages/events/vf:match:1234567/initiate_request> |
| Recovery (after)     | <p>/recovery/initiate\_request</p><p>(With after parameter)</p>           | <https://api.betradar.com/v1/vf/recovery/initiate_request>\&after=1462973515000             |
| Recovery (full)      | /recovery/initiate\_request                                               | <https://api.betradar.com/v1/vf/recovery/initiate_request>                                  |

### Subscription for Virtual Sports

There are two kinds of subscription, *UF subscription* to the UOF XML-feed, and *tournament subscriptions*.

**UF subscription**

To be able to receive messages in the UOF XML-feed, you must be subscribed to the feed. This is achieved by making a recovery request. Once the recovery request is successfully sent, you would receive messages within one minute.

**Tournament subscription**

This is a bookmaker configuration. A bookmaker must have the correct tournament subscription configured by Client Integration team to be able to receive any data (match info, odds, and so on..) for the given tournament. (Tournament subscriptions are needed for accessing any component, i.e. UOF-feed, UF Recovery, UF SportsAPI, JSON odds feed.)
