---
title: "UOF Proxy (Deprecated)"
canonical_url: "https://docs.sportradar.com/resources/widgets/docs/custom-bet/integration/uof-proxy"
markdown_url: "https://docs.sportradar.com/resources/widgets/docs/custom-bet/integration/uof-proxy.md"
last_updated: "2026-10-22T11:32:17Z"
---

# UOF Proxy (Deprecated)

> **Warning**
>
> **Deprecated.** `dataProvider: 'uofProxy'` is not offered for new Custom Bet integrations. Use [Stock Provider](https://docs.sportradar.com/resources/widgets/docs/custom-bet/integration/stock.md) instead. Existing integrations should follow [Migrating from UOF Proxy to Stock](https://docs.sportradar.com/resources/widgets/docs/custom-bet/integration/migrate-uof-proxy-to-stock.md). This page is retained for reference while you maintain legacy proxy callbacks in `dataProviderConfig`.

UOF proxy integration requires and expects responses from the unified odds feeds. So a working integration of the UOF is required. See [UOF](https://docs.sportradar.com/uof) for more information.

## Prerequisites

- **UOF API Key** → To access the API you must visit [Betradar](http://www.betradar.com/) and generate an application key associated with Betradar user details. This API key has to be sent as an HTTP header on every request towards the service.
- **Store account** → Sales need to submit a trial request through a customer account in Salesforce with all required products, sports, tournaments, and domains. After that, Jira issue will be generated, and order can be created.

### Unified Odds Feeds

The following UOF's are required to process over UOF infrastructure:

- [Available Selections](https://iodocs.betradar.com/#/CustomBet%20API/availableSelections)\
  Will return all available (and allowed) markets for the selected sport event.
- [Calculate](https://iodocs.betradar.com/#/CustomBet%20API/calculateProbability)\
  Calculate probability (odds) for your selected outcomes. This is the same list as the one from available\_selections, excluding the already picked markets and markets that aren't compatible with your selected outcomes.
- [Markets](https://iodocs.betradar.com/#/Betting%20descriptions/markets)\
  Will return descriptions of all available markets
- [Fixture](https://iodocs.betradar.com/#/Static%20sport%20event%20information/fixturesForEvent)\
  Lists the fixture for a specified event
- [Profile](https://iodocs.betradar.com/#/Entity%20descriptions/competitorInformation)\
  Name and details about a competitor (team, race driver, tennis player etc).

## Overview

![Custom Bet Proxy](https://docs.sportradar.com/resources/widgets/static/img/customBet.proxy.png)

1. Widget will request data every 30 seconds by executing functions provided to widget by `UOFDataProviderConfig` parameter. Widget will then update accordingly upon receiving necessary data by callback parameters. Detailed flow of data can be seen in chart below.
2. Those functions then calls proxy which needs to be implemented on clients side.
3. Proxy then needs to make requests to the Sportradar UOF API.
4. Response from the UOF API.
5. Response content from the UOF API is forwarded as string to the Custom Bet Widget.

### Data Flow Chart

![Custom Bet Flow Proxy](https://docs.sportradar.com/resources/widgets/static/img/customBet.flowProxy.png)

### Proxy Integration Example

```html
<script>
  (function (a, b, c, d, e, f, g, h, i) {
    /* SIR function code */
  })(
    window,
    document,
    "script",
    "https://widgets.sir.sportradar.com/betradar/widgetloader",
    "SIR",
    {
      language: "en",
      oddsType: "eu", // 'uk' or 'us' is also accepted
    },
  );

  SIR("addWidget", ".sr-widget", "customBet", {
    matchId: 123456789,
    dataProvider: "uofProxy",
    dataProviderConfig: {
      getFixture,
      getMarkets,
      calculate,
      getAvailableMarkets,
      getProfile,
      addToBetSlip,
    },
  });
</script>
<div id="sr-widget"></div>
```

## UOFDataProviderConfig

Collection of functions used for communication between the widget and client code. The widget calls these functions every 30 seconds to refresh data.

| Property              | Type                                                                                                                 | Description                                                                                                                         |
| --------------------- | -------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `getFixture`          | [`getFixture`](#getfixture)                                                                                          | Fetches fixture data from [Fixture API](https://iodocs.betradar.com/#/Static%20sport%20event%20information/fixturesForEvent)        |
| `getMarkets`          | [`getMarkets`](#getmarkets)                                                                                          | Fetches market descriptions from [Markets API](https://iodocs.betradar.com/#/Betting%20descriptions/markets)                        |
| `calculate`           | [`calculate`](#calculate)                                                                                            | Calculates odds from [Calculate API](https://iodocs.betradar.com/#/CustomBet%20API/calculateProbability)                            |
| `getAvailableMarkets` | [`getAvailableMarkets`](#getavailablemarkets)                                                                        | Fetches available selections from [Available Selections API](https://iodocs.betradar.com/#/CustomBet%20API/availableSelections)     |
| `getProfile`          | [`getProfile`](#getprofile)                                                                                          | Fetches competitor profile from [Competitor Profile API](https://iodocs.betradar.com/#/Entity%20descriptions/competitorInformation) |
| `addToBetSlip`        | [`addToBetSlip`](https://docs.sportradar.com/resources/widgets/docs/custom-bet/integration/overview.md#addtobetslip) | Called when the user clicks "Add to bet slip" button                                                                                |

## Types

### UOFDataProviderCallback

Callback function shared by all data provider functions. Pass UOF XML response as a string.

| Parameter | Type                                                                                                                                  | Description                         |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------- |
| `error`   | [`CBError`](https://docs.sportradar.com/resources/widgets/docs/custom-bet/integration/overview.md#cberror) \| `string` \| `undefined` | Error object, or `false` on success |
| `data`    | `string`                                                                                                                              | Forwarded UOF XML data as string    |

**Example:**

```javascript
// Success
callback(false, xmlString);

// Error
callback({ type: 1, message: "Could not fetch data" });
```

### `getFixture`

Fetches fixture data for a given match. It is given `matchId` and expects callback function [`UOFDataProviderCallback`](#uofdataprovidercallback) to be executed with UOF data.

| Parameter  | Type                                                                                                           | Description                    |
| ---------- | -------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| `args`     | [`MatchArgs`](https://docs.sportradar.com/resources/widgets/docs/custom-bet/integration/overview.md#matchargs) | Match identifier               |
| `callback` | [`UOFDataProviderCallback`](#uofdataprovidercallback)                                                          | Callback with UOF XML response |

```javascript
function getFixture(args, callback) {
  fetch(`${apiUrl}/v1/sports/${lang}/sport_events/${args.matchId}/fixture.xml`)
    .then((res) => (res.ok ? res.text() : Promise.reject(res)))
    .then((xml) => callback(false, xml))
    .catch(() => callback({ type: 1, message: "Could not get fixture data" }));
}
```

### `getMarkets`

Fetches all market descriptions. No arguments are required. Expects callback function [`UOFDataProviderCallback`](#uofdataprovidercallback) to be executed with UOF data.

| Parameter  | Type                                                  | Description                    |
| ---------- | ----------------------------------------------------- | ------------------------------ |
| `args`     | -                                                     | No arguments required          |
| `callback` | [`UOFDataProviderCallback`](#uofdataprovidercallback) | Callback with UOF XML response |

```javascript
function getMarkets(args, callback) {
  fetch(`${apiUrl}/v1/descriptions/${lang}/markets.xml?include_mappings=true`)
    .then((res) => (res.ok ? res.text() : Promise.reject(res)))
    .then((xml) => callback(false, xml))
    .catch(() => callback({ type: 1, message: "Could not get markets data" }));
}
```

### `calculate`

Calculates probability (odds) for selected outcomes. It is given `matchId` and `selectedOutcomes`, and expects callback function [`UOFDataProviderCallback`](#uofdataprovidercallback) to be executed with UOF data. Sends selections as XML via POST.

| Parameter  | Type                                                                                                                   | Description                                    |
| ---------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------- |
| `args`     | [`CalculateArgs`](https://docs.sportradar.com/resources/widgets/docs/custom-bet/integration/overview.md#calculateargs) | Match ID and array of selected outcome objects |
| `callback` | [`UOFDataProviderCallback`](#uofdataprovidercallback)                                                                  | Callback with UOF XML response                 |

```javascript
function calculate(args, callback) {
  var body = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <filterSelections xmlns="http://schemas.sportradar.com/custombet/v1/endpoints">
      <selection id="${args.matchId}">
        ${args.selectedOutcomes.map((o) => o.getSelection()).join(" ")}
      </selection>
    </filterSelections>`;

  fetch(`${apiUrl}/v1/custombet/calculate-filter`, {
    method: "POST",
    headers: { "Content-Type": "application/xml" },
    body: body,
  })
    .then((res) => (res.ok ? res.text() : Promise.reject(res)))
    .then((xml) => callback(false, xml))
    .catch(() => callback({ type: 3, message: "Could not calculate odds" }));
}
```

> **Info**
>
> Each [`UniqueOutcome`](https://docs.sportradar.com/resources/widgets/docs/custom-bet/integration/overview.md#uniqueoutcome) object exposes helper methods — `getSelection()` builds the XML element for the UOF endpoint, `equals()` and `isSameMarket()` compare outcomes, and `toString()` returns a string representation. See [UniqueOutcome Methods](https://docs.sportradar.com/resources/widgets/docs/custom-bet/integration/overview.md#uniqueoutcome-methods) for details.

### `getAvailableMarkets`

Fetches all available (and allowed) markets for a match. It is given `matchId` and expects callback function [`UOFDataProviderCallback`](#uofdataprovidercallback) to be executed with UOF data.

| Parameter  | Type                                                                                                           | Description                    |
| ---------- | -------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| `args`     | [`MatchArgs`](https://docs.sportradar.com/resources/widgets/docs/custom-bet/integration/overview.md#matchargs) | Match identifier               |
| `callback` | [`UOFDataProviderCallback`](#uofdataprovidercallback)                                                          | Callback with UOF XML response |

```javascript
function getAvailableMarkets(args, callback) {
  fetch(`${apiUrl}/v1/custombet/${args.matchId}/available_selections`)
    .then((res) => (res.ok ? res.text() : Promise.reject(res)))
    .then((xml) => callback(false, xml))
    .catch(() =>
      callback({ type: 1, message: "Could not get available markets" }),
    );
}
```

### `getProfile`

Fetches competitor (team/player) profile data. It is given `teamId` and expects callback function [`UOFDataProviderCallback`](#uofdataprovidercallback) to be executed with UOF data.

| Parameter  | Type                                                                                                         | Description                    |
| ---------- | ------------------------------------------------------------------------------------------------------------ | ------------------------------ |
| `args`     | [`TeamArgs`](https://docs.sportradar.com/resources/widgets/docs/custom-bet/integration/overview.md#teamargs) | Competitor identifier          |
| `callback` | [`UOFDataProviderCallback`](#uofdataprovidercallback)                                                        | Callback with UOF XML response |

```javascript
function getProfile(args, callback) {
  fetch(`${apiUrl}/v1/sports/${lang}/competitors/${args.teamId}/profile.xml`)
    .then((res) => (res.ok ? res.text() : Promise.reject(res)))
    .then((xml) => callback(false, xml))
    .catch(() => callback({ type: 1, message: "Could not get profile data" }));
}
```
