api.video Docs - API Reference, SDK

Welcome to the api.video developer hub. You'll find comprehensive guides and documentation to help you start working with api.video as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

Go API client

Go API client for api.video service (beta version)

api.video Golang api client

api.video is an API that encodes on the go to facilitate immediate playback, enhancing viewer streaming experiences across multiple devices and platforms. You can stream live or on-demand online videos within minutes.

Warning

This API client is still in beta. Please feel free to report any issue you may encounter.

Installation

go get github.com/apivideo/go-api-client

Getting Started

For a more advanced usage you can checkout the rest of the documentation in the docs directory

package main

import (
    "fmt"
    "os"
    apivideosdk "github.com/apivideo/go-api-client"
)

func main() {
    //Connect to production environment
    client := apivideosdk.ClientBuilder("YOUR_API_TOKEN").Build()

    // if you rather like to use the sandbox environment:
    // client := apivideosdk.SandboxClientBuilder("YOU_SANDBOX_API_TOKEN").Build()


    //List Videos
    //First create the url options for searching
    opts := apivideosdk.VideosApiListRequest{}.
        CurrentPage(1).
        PageSize(25).
        SortBy("publishedAt").
        SortOrder("desc")

    //Then call the List endpoint with the options
    result, err := client.Videos.List(opts)

    if err != nil {
        fmt.Println(err)
    }

    for _, video := range result.Data {
        fmt.Printf("%s\n", *video.VideoId)
        fmt.Printf("%s\n", *video.Title)
    }


    //Upload a video
    //First create a container
    create, err := client.Videos.Create(apivideosdk.VideoCreationPayload{Title: "My video title"})

    if err != nil {
        fmt.Println(err)
    }

    //Then open the video file
    videoFile, err := os.Open("path/to/video.mp4")

    if err != nil {
        fmt.Println(err)
    }

    //Finally upload your video to the container with the videoId
    uploadedVideo, err := client.Videos.UploadFile(*create.VideoId, videoFile)

    if err != nil {
        fmt.Println(err)
    }


    //And get the assets
    fmt.Printf("%s\n", *uploadedVideo.Assets.Hls)
    fmt.Printf("%s\n", *uploadedVideo.Assets.Iframe)
}

Documentation for API Endpoints

All URIs are relative to https://ws.api.video

Captions API

Retrieve an instance of the Captions API:

client := apivideosdk.ClientBuilder("API_VIDEO_KEY").Build()
captionsApi := client.Captions

Endpoints

MethodHTTP requestDescription
DeleteDelete /videos/{videoId}/captions/{language}Delete a caption
ListGet /videos/{videoId}/captionsList video captions
GetGet /videos/{videoId}/captions/{language}Show a caption
UpdatePatch /videos/{videoId}/captions/{language}Update caption
UploadPost /videos/{videoId}/captions/{language}Upload a caption

Chapters API

Retrieve an instance of the Chapters API:

client := apivideosdk.ClientBuilder("API_VIDEO_KEY").Build()
chaptersApi := client.Chapters

Endpoints

MethodHTTP requestDescription
DeleteDelete /videos/{videoId}/chapters/{language}Delete a chapter
ListGet /videos/{videoId}/chaptersList video chapters
GetGet /videos/{videoId}/chapters/{language}Show a chapter
UploadPost /videos/{videoId}/chapters/{language}Upload a chapter

LiveStreams API

Retrieve an instance of the LiveStreams API:

client := apivideosdk.ClientBuilder("API_VIDEO_KEY").Build()
liveStreamsApi := client.LiveStreams

Endpoints

MethodHTTP requestDescription
DeleteDelete /live-streams/{liveStreamId}Delete a live stream
DeleteThumbnailDelete /live-streams/{liveStreamId}/thumbnailDelete a thumbnail
ListGet /live-streamsList all live streams
GetGet /live-streams/{liveStreamId}Show live stream
UpdatePatch /live-streams/{liveStreamId}Update a live stream
CreatePost /live-streamsCreate live stream
UploadThumbnailPost /live-streams/{liveStreamId}/thumbnailUpload a thumbnail

PlayerThemes API

Retrieve an instance of the PlayerThemes API:

client := apivideosdk.ClientBuilder("API_VIDEO_KEY").Build()
playerThemesApi := client.PlayerThemes

Endpoints

MethodHTTP requestDescription
DeleteDelete /players/{playerId}Delete a player
DeleteLogoDelete /players/{playerId}/logoDelete logo
ListGet /playersList all players
GetGet /players/{playerId}Show a player
UpdatePatch /players/{playerId}Update a player
CreatePost /playersCreate a player
UploadLogoPost /players/{playerId}/logoUpload a logo

RawStatistics API

Retrieve an instance of the RawStatistics API:

client := apivideosdk.ClientBuilder("API_VIDEO_KEY").Build()
rawStatisticsApi := client.RawStatistics

Endpoints

MethodHTTP requestDescription
ListLiveStreamSessionsGet /analytics/live-streams/{liveStreamId}List live stream player sessions
ListSessionEventsGet /analytics/sessions/{sessionId}/eventsList player session events
ListVideoSessionsGet /analytics/videos/{videoId}List video player sessions

UploadTokens API

Retrieve an instance of the UploadTokens API:

client := apivideosdk.ClientBuilder("API_VIDEO_KEY").Build()
uploadTokensApi := client.UploadTokens

Endpoints

MethodHTTP requestDescription
DeleteTokenDelete /upload-tokens/{uploadToken}Delete an upload token
ListGet /upload-tokensList all active upload tokens.
GetTokenGet /upload-tokens/{uploadToken}Show upload token
CreateTokenPost /upload-tokensGenerate an upload token

Videos API

Retrieve an instance of the Videos API:

client := apivideosdk.ClientBuilder("API_VIDEO_KEY").Build()
videosApi := client.Videos

Endpoints

MethodHTTP requestDescription
DeleteDelete /videos/{videoId}Delete a video
GetGet /videos/{videoId}Show a video
GetStatusGet /videos/{videoId}/statusShow video status
ListGet /videosList all videos
UpdatePatch /videos/{videoId}Update a video
PickThumbnailPatch /videos/{videoId}/thumbnailPick a thumbnail
UploadWithUploadTokenPost /uploadUpload with an upload token
CreatePost /videosCreate a video
UploadPost /videos/{videoId}/sourceUpload a video
UploadThumbnailPost /videos/{videoId}/thumbnailUpload a thumbnail

Webhooks API

Retrieve an instance of the Webhooks API:

client := apivideosdk.ClientBuilder("API_VIDEO_KEY").Build()
webhooksApi := client.Webhooks

Endpoints

MethodHTTP requestDescription
DeleteDelete /webhooks/{webhookId}Delete a Webhook
GetGet /webhooks/{webhookId}Show Webhook details
ListGet /webhooksList all webhooks
CreatePost /webhooksCreate Webhook

Documentation For Models

Updated 11 days ago


Go API client


Go API client for api.video service (beta version)

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.