Video Upload Guide
Legacy Twitch API v5 is deprecated and scheduled to be decommissioned on February 28, 2022. For more information, refer to the timeline announcement and the v5 migration guide to use the latest version of the Twitch API.
This guide covers how to use API endpoints to upload videos, enabling you to create tools for creating and managing videos on Twitch. If instead you are looking for information on how to upload videos in the Creator Dashboard, please see the Video on Demand Twitch help article for the latest information. In either case, please note that the channel uploading videos must be a Twitch Partner or Affiliate.
Broadcasters often like to add personal branding (for intros and outros) and create compilation videos from their streams. With the video endpoints, you can enable those experiences and upload the end result directly to Twitch.
When uploading a video, the API accepts the following formats:
- MP4, MOV, AVI and FLV file formats
- AAC audio
- h264 codec
- Up to 10Mbps bitrate
- Up to 1080p/60FPS
There is a rate limit of 5 simultaneous uploads per user, with a maximum of 100 uploads in 24 hours.
How to Upload a Video
1. Get an Authentication Token
You need an OAuth token with the
channel_editor scope for the channel where the video will live. Once you have the token, you add it to the
Authorization header when you create the video.
For information about getting OAuth access tokens, see the Apps & Authentication Guide.
2. Create a Video
See the Create Video endpoint.
This example creates a video entitled “Test video” in the 44322889 channel.
curl -H 'Accept: application/vnd.twitchtv.v5+json' \ -H 'Authorization: OAuth cfabdegwdoklmawdzdo98xt2fo512y' \ -H 'Client-ID: uo6dggojyb8d6soh92zknwmi5ej1q2' \ -X POST 'https://api.twitch.tv/kraken/videos?channel_id=44322889&title=Test video'
The response will include the following information, which is used in subsequent steps:
- video ID:
- upload token:
3. Upload Video Parts
See the Upload Video Part endpoint.
This uploads the first part of video 106400740, created in the prior step.
curl -H 'Content-Length: 8896493' \ --data-binary "@test.mp4" \ -X PUT 'https://uploads.twitch.tv/upload/106400740?part=1&upload_token=7_STl2gsKwDy1mHj2k95ld3aodDl3E_NzzQdSlN9ll0p6Ct0xFhvrO5bWu7tGUKEH5jtD_hjB9q3X4vTOQ000B1UcmMxduT30FuHhAmFYgYf7DoJE9PVvGRZqk9WQAR2ZGphUpj_237smnjE2gMoaQ--'
4. Complete the Video Upload
See the Complete Video Upload endpoint.
This example completes the upload of video 106400740.
curl -X POST 'https://uploads.twitch.tv/upload/106400740/complete?upload_token=7_STl2gsKwDy1mHj2k95ld3aodDl3E_NzzQdSlN9ll0p6Ct0xFhvrO5bWu7tGUKEH5jtD_hjB9q3X4vTOQ000B1UcmMxduT30FuHhAmFYgYf7DoJE9PVvGRZqk9WQAR2ZGphUpj_237smnjE2gMoaQ--'