Developer Portal API

Introduction

We have a set of developer portal APIs that can be useful for you. These methods are not accessible via SDK and you should use them on your backend to revtrieve various data about your app business performance and analytics.

Authentication

All http request should be sent with Authorization header and bearer token that can be acquired from the developer portal: https://platform.streamlabs.com. Its the same token that you are using for app development in the Streamlabs Desktop.

1310

Authorization token

This token should be provided via Http Authorization header like from example below:
Authorization: Bearer {your_token_here}

API Reference

Get subscriptions details

Use this endpoint to retrieve data about active and canceled subscriptions and their expiration dates.

📘

NOTE: Keep in mind that we update this data when subscription status changes (e.g.it transfers from active to canceled state). So if you make several requests to this endpoint with the same parameters response data may vary.

GET https://platform.streamlabs.com/api/v1/developer/subscriptions?start={start_date}&end={end_date}

Parameter

Type

Description

start

date, optional
Format: YYYY-MM-DD

Also you can provide more detailed date format:
YYYY-MM-DD HH:mm:ss

Start date

end

date, required if start is provided
Format: YYYY-MM-DD

Also you can provide more detailed date format:
YYYY-MM-DD HH:mm:ss

End date

user_id

Number

Streamlabs user ID

id

Number

Subscription ID

is_test

Boolean

if true, test data are returned

Example:

curl  "https://platform.streamlabs.com/api/v1/developer/subscriptions?start=2018-05-30&end=2019-05-30" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' 
-H 'authorization: Bearer ..qfUNJeUO1vBgxpotlR_F1J0TzXD8Zif1o8R01hE1-l8'

curl  "https://platform.streamlabs.com/api/v1/developer/subscriptions?user_id=4"\
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'authorization: Bearer ..qfUNJeUO1vBgxpotlR_F1J0TzXD8Zif1o8R01hE1-l8'

#If id(subscription_id) is specified, there is no pagination in the result.
curl  "https://platform.streamlabs.com/api/v1/developer/subscriptions?id=4" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'authorization: Bearer ..qfUNJeUO1vBgxpotlR_F1J0TzXD8Zif1o8R01hE1-l8'

{
  "id":4,
  "streamlabs_id":1,
  "status":"active",
  "expires_at":"2018-12-17 22:33:12"
}

Response will be paginated and you can retrieve additional pages if they exists.
Response example:

{
    "current_page": 1,
    "data": [
        {
            "id": 1,
            "streamlabs_id": 1,
            "status": "canceled",
            "expires_at": "2018-09-25 08:15:41"
        },
        {
            "id": 2,
            "streamlabs_id": 2,
            "status": "active",
            "expires_at": "2018-09-11 12:13:27"
        },
        {
            "id": 3,
            "streamlabs_id": 3,
            "status": "active",
            "expires_at": "2018-09-24 12:41:50"
        },
        {
            "id": 4,
            "streamlabs_id": 4,
            "status": "canceled",
            "expires_at": "2018-09-24 12:41:50"
        }
    ],
    "first_page_url": "http://platform.streamlabs.com/api/v1/developer/subscriptions?start=2018-09-11+09%3A10%3A10&end=2018-09-24&page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "http://platform.streamlabs.com/api/v1/developer/subscriptions?start=2018-09-11+09%3A10%3A10&end=2018-09-24&page=1",
    "next_page_url": null,
    "path": "http://platform.streamlabs.com/api/v1/developer/subscriptions",
    "per_page": 200,
    "prev_page_url": null,
    "to": 4,
    "total": 4
}

Where pagination wrapper contains these fields:

Name

Type

Description

current_page

number

Current page number

data

array of subscriptions objects

Subscriptions details

per_page

number

Number of items per page

total

number

Total number of rows returned

last_page

number

Last page number. If current_page equals last_page than no more pages available

next_page_url

string, nullable

URL to the next page. You can reuse this url to fetch next page if its not null

Subscription is an object that contains these fields:

Name

Type

Description

streamlabs_id

number

Streamlabs id of this user

status

string
active, canceled

Subscription status.
Canceled status means that user unsubscribes from your app but it is still active before expires_at date.

expires_at

date

Subscription expiration date

Get user settings details

Retrieve a paginated list of user profiles and stored user settings.

GET https://platform.streamlabs.com/api/v1/developer/users/settings?usernames={usernamesList}&platform={platform}

You can provide a query parameters to enable filtering based on usernames or send a request without them. If no query parameters are provided, then paginated response will be returned with users settings.

Parameter

Type

Description

usernames

array, optional

Example:
usernames=bob,test,test2

Comma-separated list of usernames. Only 20 usernames per request are allowed.

platform

string, optional

Platform name.

Currently, only twitch supported

Response will be paginated and you can retrieve additional pages if they exists.
Response example:

{
	"current_page": 1,
	"data": [{
		"user": {
			"streamlabs": {
				"id": 1
			},
			"twitch": {
				"twitch_id": 158874310,
				"display_name": "test",
				"name": "test",
				"partnered": 0,
				"icon_url": "https://static-cdn.jtvnw.net/user-default-pictures/bb97f7e6-f11a-4194-9708-52bf5a5125e8-profile_image-300x300.jpg",
				"profile_banner_url": null,
				"profile_background_color": null
			}
		},
		"settings": {
			"hello": "test",
			"test": "test",
			"sadads": "asdasda"
		}
	}],
	"first_page_url": "https://platform.streamlabs.com/api/v1/developer/users/settings?page=1",
	"from": 1,
	"last_page": 1,
	"last_page_url": "https://platform.streamlabs.com/api/v1/developer/users/settings?page=1",
	"next_page_url": null,
	"path": "https://platform.streamlabs.com/api/v1/developer/users/settings",
	"per_page": 20,
	"prev_page_url": null,
	"to": 1,
	"total": 1
}

Where paginated wrapper is in our default wrapper for paginated response and data is an array of user settings object:

Parameter

Type

Description

user

Object

Info about user profiles

user.streamlabs

Object

Info about streamlabs account

user.twitch

Object

Info about twitch account

setting

Object

Object that contains user settings in a key-value format

Get user accounts

Retrieve data about user connected accounts (twitch, youtube, mixer, etc).

GET https://platform.streamlabs.com/api/v1/developer/users/{streamlabsId}

Streamlabs ID can be acquired from init response.

Returns Profiles Object