Sandbox environment
Learn how to use the sandbox environment for LoL and CS
Overview
The API sandbox allows developers to simulate game conditions for Counter-Strike and League of Legends, enabling seamless integration testing without waiting for live-supported matches. This environment is designed to help developers test code or adapt to API changes on demand, enhancing flexibility.
Usage
The sandbox environment can be accessed by following these steps:
- Call the replay API for LoL or CS. This will provide the WebSocket URLs for the specified videogame.
- Create a WebSocket connection using your token and the provided event/frame WebSocket URLs.
1. Call the replay API
Users can send a POST request to the replay endpoints below to access the sandbox environment. Query parameters can be utilised to adjust the output.
League of Legends
API request
POST https://live.pandascore.co/api/lol/replay
API response
{
"playback_speed": 1.0,
"ingame_timestamp": null,
"events_url": "wss://live.pandascore.co/replays/league-of-legends/events",
"frames_url": "wss://live.pandascore.co/replays/league-of-legends/frames"
}
Counter-Strike
API request
POST https://live.pandascore.co/api/csgo/replay
API response
{
"playback_speed": 1.0,
"round_number": null,
"events_url": "wss://live.pandascore.co/replays/cs-go/events",
"frames_url": "wss://live.pandascore.co/replays/cs-go/frames"
}
2. Create a WebSocket connection
The LoL and CS replay API endpoints each return 2 WebSocket URLs, these can be used to replay events and frames respectively. Open a WebSocket connection to one of these URLs to simulate game data.
Query Parameters
Each frame informs the user of the game, match and tournament id
's (integer), as well as the:
playback_speed
- the speed at which events and frames are streamed (enum). There are several options for the playback_speed:1
(default)1.5
2
For example, to double the playback speed, use?playback_speed=2
.
ingame_timestamp
- the in-game timestamp (in seconds) where the replay begins (integer). The defaultingame_timestamp
is0
. For example, to start the replay at the 10-minute mark in-game, use?ingame_timestamp=600
. This is available for League of Legends frames and events only.round_number
- the in-game round number where the replay begins (integer). The defaultround_number
is1
. For example, to begin the replay at the 5th round in-game, use?round_number=5
. This is available for Counter-Strike frames and events only.
Updated 27 days ago