Skip to content

Instantly share code, notes, and snippets.

@Durss
Last active September 25, 2024 12:01
Show Gist options
  • Save Durss/c5c09ed46bee5283757b0c91050d2b8b to your computer and use it in GitHub Desktop.
Save Durss/c5c09ed46bee5283757b0c91050d2b8b to your computer and use it in GitHub Desktop.
Undocumented Streamlabs Charity endpoints

Undocumented Streamlabs Charity endpoints

Get details about a team

https://streamlabscharity.com/api/v1/teams/@{TEAM-NAME}/{CAMPAIGN-NAME}
ℹ️ it allows to retreive the {TEAM_ID} necessary for next endpoints

Get all members of a team

https://streamlabscharity.com/api/v1/teams/{TEAM_ID}/members?page=1

See data format
interface StreamlabsCharityTeam {
	id: string;
	display_name: string;
	slug: string;
	public: boolean;
	amount_raised: number;
	amount_raised_usd: number;
	campaign: {
		id: string;
		display_name: string;
		slug: string;
		starts_at: string;
		ends_at: string;
		currency: string;
		amount_raised: number;
		amount_raised_usd: number;
		active_milestone_widget: boolean;
		creator: {
			id: string;
			display_name: string;
			slug: string;
			is_live: boolean;
			currency: string;
			avatar: {
				url: string;
			};
		};
		causable: {
			id: string;
			display_name: string;
			slug: string;
			description: string;
			enable_fundraising: boolean;
			rank: number;
			amount_raised: number;
			has_paypal: boolean;
			has_stripe: boolean;
			external_platforms: {
				ppgf: boolean;
				benevity: boolean;
				platform_id?: any;
			};
			avatar: {
				url: string;
			};
			page_settings: {
				header_url: string;
				website_url: string;
				video_url?: any;
				donation_box_settings: {
					opt_in: boolean;
					options: {
						option_1: {
							value: number;
							description: string;
						};
						option_2: {
							value: number;
							description: string;
						};
						option_3: {
							value: number;
							description: string;
						};
						option_4: {
							value: number;
							description: string;
						};
						description: string;
					};
					custom_donation_checkbox: boolean;
					custom_donation_checkbox_value: boolean;
					custom_donation_checkbox_display_name: string;
				};
				min_don_amount: number;
				twitter: string;
				facebook: string;
				twitch?: any;
				instagram: string;
				youtube: string;
				discord?: any;
				misc_url?: any;
				misc_url_2?: any;
				misc_url_3?: any;
				extras: {
					title_font: {
						kind: string;
						files: {
							'300': string;
							'600': string;
							'700': string;
							'800': string;
							italic: string;
							regular: string;
							'300italic': string;
							'600italic': string;
							'700italic': string;
							'800italic': string;
						};
						family: string;
						subsets: string[];
						version: string;
						category: string;
						variants: string[];
						lastModified: string;
					};
					title_weight: string;
					primary_button_color: string;
					secondary_button_color: string;
					primary_button_text_color: string;
					secondary_button_text_color: string;
				};
				toolkit_url?: any;
			};
			details: {
				country: string;
				currency: string;
			};
			tags: {
				id: string;
				name: string;
			}[];
			rating?: any;
		};
		goal: {
			id: string;
			amount: number;
			completed: boolean;
		};
		page_settings: {
			description: string;
			header_url: string;
		};
		active_giveaway?: any;
		rewards: any[];
	};
	rewards: any[];
	members:  {
		id: string;
		team_alerts: boolean;
		team_donation_goal: boolean;
		user: {
			id: string;
			display_name: string;
			slug: string;
			is_live: boolean;
			currency: string;
			avatar: {
				url: string;
			};
		};
	}[];
	goal:  {
		id: string;
		amount: number;
		currency: string;
	};
}

Get top streamers and donators of a team

https://streamlabscharity.com/api/v1/teams/{TEAM_ID}/leaderboards
⚠️ Streamlabs seems to flush its content after a few days of inactivity. Making a new donation will restore the leaderboard

See data format
interface StreamlabsCharityLeaderboard{
	top_streamers: {
		amount: string;
		display_name: string;
	}[];
	top_donators: {
		display_name: string;
		amount: number;
		comment: {
			id: string;
			text: string;
		};
	}[];
}

Get all donations of a team

https://streamlabscharity.com/api/v1/teams/{TEAM_ID}/donations
⚠️ Will return an empty array if you have an active Streamlabs session on the browser you open this link from. Open it in private navigation to actually get the data (don't ask me why....)

You can paginate the result with the page parameter:
https://streamlabscharity.com/api/v1/teams/{TEAM_ID}/donations?page=2

See data format
interface StreamlabsCharityDonationHistoryEntry {
	id: string;
	donation: {
		id: string;
		display_name: string;
		amount_usd: number;
		converted_currency: string;
		converted_amount: number;
		original_currency: string;
		original_amount: number;
		team_currency: string;
		team_amount: number;
		member_currency: string;
		member_amount: number;
		country: string;
		created_at: string;
		team_member_id: string;
		comment: {
			id: string;
			text: string;
		};
		extra_information: any;
	};
	member: {
		id: string;
		user: {
			id: string;
			display_name: string;
			slug: string;
			is_live: boolean;
			currency: string;
		}
	}
}

Get milestones the user configured for a campaign:

Copy the URL of the milestones overlay, it should look like this:

https://streamlabscharity.com/widgets/milestone/{TOKEN}


Grab the {TOKEN} part and use it to call the following endpoint:
https://streamlabscharity.com/api/v1/widgets/milestones/{TOKEN}

Get notified when receiving a donation

Simply subscribe to websocket event as explained on the official documentation. You'll get an event of type streamlabscharitydonation.

See data format of the event
interface StreamlabsCharityDonationEvent {
	type: "streamlabscharitydonation";
	for:"streamlabscharity";
	message: {
		charityDonationId: string;
		formattedAmount: string;
		/**
		 * @deprecated Only used when simulating an event IIRC. The live data uses "formattedAmount"
		 */
		formatted_amount: string;
		currency: string;
		amount: string;
		message: string;
		to?: {
			name: string;
		};
		memberId: string;
		from: string;
		id: number;
		userId: string;
		campaignId: string;
		createdAt: string;
		custom: unknown;
		_id: string;
		priority: number;
		senderId?: number;
		isTest?: boolean;
		isPreview?: boolean;
		unsavedSettings?: any[];
	}[];
    event_id: string;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment