Overview
The Adapter is the integration layer that connects SIR Widgets to your betting platform's data. It acts as a translator between your odds API and the widgets, transforming your data format into the structure widgets expect. By implementing a single adapter, all widgets in your application can access your betting data through standardized endpointsβeliminating duplicate integration work and enabling rapid widget deployment.
What is an Adapter?
An adapter is a JavaScript object that runs client-side in the browser and serves as the data bridge for all widgets:
Receives requests β Widgets call adapter endpoints with specific parameters (event ID, market type, language, etc.)
Fetches data β The adapter retrieves data from your betting API or WebSocket feed
Transforms data β Your API response is mapped to the format defined by the SIR Widgets specification
Delivers updates β Data is passed back to widgets via callbacks, with optional real-time subscriptions
Key benefits:
Write once, use everywhere β A single adapter implementation serves all widgets
Full control β You manage caching, rate limiting, and data transformation logic
Real-time ready β Built-in subscription patterns support live odds updates
Two implementation options β Build your own (self-service) or use a Sportradar-hosted adapter for supported data providers
Adapter Types
SIR Widgets supports two types of adapter implementations:
1. Self-Service Adapter
A custom adapter implementation that you develop yourself. This gives you complete control over:
Data fetching and updating logic
Caching strategies
Transformation rules
Use when:
You want full control over implementation
You're not using one of supported data provider
Learn more about Self-Service Implementation β
2. Hosted Adapter
A hosted adapter implementation provided and by Sportradar that works with common data providers. Sportradar manages:
Implementation details
Updates and maintenance
Use when:
You're using a supported data provider (e.g., Sportradar)
Learn more about Hosted Implementation β
Integration Example
This example shows starting from scratch with a plain HTML file. If you're integrating into an existing website, add the corresponding elements to your existing pages.
Replace <YOUR_CLIENT_ID> with your actual Sportradar client ID. Also replace <WIDGET_NAME> and ...widgetProps with the actual widget name and configuration.
Register the adapter once on page load, before adding any widgets. Do not call registerAdapter multiple times or register different adapters. Doing so will cause unpredictable behavior. Widgets added before adapter registration will fail to load data.
Self-service example
Learn more about Self-Service Implementation β
Hosted Example"
Learn more about Hosted Implementation β
Next Steps
Last updated
Was this helpful?