Skip to content
datasportsAPI

WebSocketStream ticket

Documentation

/

Type to filter the docs by title or path.

WebSocketEndpoint 115 of 116

Stream ticket

POST

/v2/stream/ticket

Plan
Business
Auth
Bearer dsa_live_…
Parameters
None
Returns
An object (see Response)

Issues a one-time ticket for opening a connection, valid for 30 seconds. The call is authenticated, rate-limited and counted against your usage exactly like any other /v2 request, and it takes no request body.

Plan access

Requires the Business plan; on any other plan the ticket request returns 403 ws_not_available.

01Request

Shown with cURL; swap the placeholder for a key of yours. Installing a client: SDKs & CLI.

cURL
curl -X POST -H "Authorization: Bearer dsa_live_…" \
    "https://api.datasportsapi.com/v2/stream/ticket"

02Response

The top-level keys of the JSON body. Each object links to its full shape in the data reference.

data
{ ticket: string; url: string; expiresInSeconds: number }
Example call and response
$ curl -X POST -H "Authorization: Bearer dsa_live_…" https://api.datasportsapi.com/v2/stream/ticket

{ "data": { "ticket": "8373e1…", "url": "wss://api.datasportsapi.com/?ticket=8373e1…", "expiresInSeconds": 30 } }

03Errors

  • 403ws_not_available

    WebSocket access is not part of your plan

Any key can also meet401unauthorized429rate_limited429quota_exceeded500internal_errorEvery error code