MCPcopy Index your code
hub / github.com/apivideo/api.video-go-client

github.com/apivideo/api.video-go-client @v1.4.7

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.4.7 ↗ · + Follow
2,687 symbols 3,571 edges 103 files 1,932 documented · 72%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

badge   badge   badge

api.video Go client

api.video is the video infrastructure for product builders. Lightning fast video APIs for integrating, scaling, and managing on-demand & low latency live streaming features in your app.

Table of contents

Project description

api.video's Go client streamlines the coding process. Chunking files is handled for you, as is pagination and refreshing your tokens.

Getting started

Installation

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

Code sample

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/api.video-go-client"
)

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

    // if you rather like to use the sandbox environment:
    // client := apivideosdk.SandboxClientBuilder("YOU_SANDBOX_API_KEY").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

API Endpoints

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

Analytics

Retrieve an instance of the Analytics API:
client := apivideosdk.ClientBuilder("API_VIDEO_KEY").Build()
analyticsApi := client.Analytics
Endpoints
Method HTTP request Description
GetAggregatedMetrics Get /data/metrics/{metric}/{aggregation} Retrieve aggregated metrics
GetMetricsBreakdown Get /data/buckets/{metric}/{breakdown} Retrieve metrics in a breakdown of dimensions
GetMetricsOverTime Get /data/timeseries/{metric} Retrieve metrics over time

Captions

Retrieve an instance of the Captions API:
client := apivideosdk.ClientBuilder("API_VIDEO_KEY").Build()
captionsApi := client.Captions
Endpoints
Method HTTP request Description
Upload Post /videos/{videoId}/captions/{language} Upload a caption
Get Get /videos/{videoId}/captions/{language} Retrieve a caption
Update Patch /videos/{videoId}/captions/{language} Update a caption
Delete Delete /videos/{videoId}/captions/{language} Delete a caption
List Get /videos/{videoId}/captions List video captions

Chapters

Retrieve an instance of the Chapters API:
client := apivideosdk.ClientBuilder("API_VIDEO_KEY").Build()
chaptersApi := client.Chapters
Endpoints
Method HTTP request Description
Upload Post /videos/{videoId}/chapters/{language} Upload a chapter
Get Get /videos/{videoId}/chapters/{language} Retrieve a chapter
Delete Delete /videos/{videoId}/chapters/{language} Delete a chapter
List Get /videos/{videoId}/chapters List video chapters

LiveStreams

Retrieve an instance of the LiveStreams API:
client := apivideosdk.ClientBuilder("API_VIDEO_KEY").Build()
liveStreamsApi := client.LiveStreams
Endpoints
Method HTTP request Description
Create Post /live-streams Create live stream
Get Get /live-streams/{liveStreamId} Retrieve live stream
Update Patch /live-streams/{liveStreamId} Update a live stream
Delete Delete /live-streams/{liveStreamId} Delete a live stream
List Get /live-streams List all live streams
UploadThumbnail Post /live-streams/{liveStreamId}/thumbnail Upload a thumbnail
DeleteThumbnail Delete /live-streams/{liveStreamId}/thumbnail Delete a thumbnail
Complete Put /live-streams/{liveStreamId}/complete Complete a live stream

PlayerThemes

Retrieve an instance of the PlayerThemes API:
client := apivideosdk.ClientBuilder("API_VIDEO_KEY").Build()
playerThemesApi := client.PlayerThemes
Endpoints
Method HTTP request Description
Create Post /players Create a player
Get Get /players/{playerId} Retrieve a player
Update Patch /players/{playerId} Update a player
Delete Delete /players/{playerId} Delete a player
List Get /players List all player themes
UploadLogo Post /players/{playerId}/logo Upload a logo
DeleteLogo Delete /players/{playerId}/logo Delete logo

Summaries

Retrieve an instance of the Summaries API:
client := apivideosdk.ClientBuilder("API_VIDEO_KEY").Build()
summariesApi := client.Summaries
Endpoints
Method HTTP request Description
Create Post /summaries Generate video summary
Update Patch /summaries/{summaryId}/source Update summary details
Delete Delete /summaries/{summaryId} Delete video summary
List Get /summaries List summaries
GetSummarySource Get /summaries/{summaryId}/source Get summary details

Tags

Retrieve an instance of the Tags API:
client := apivideosdk.ClientBuilder("API_VIDEO_KEY").Build()
tagsApi := client.Tags
Endpoints
Method HTTP request Description
List Get /tags List all video tags

UploadTokens

Retrieve an instance of the UploadTokens API:
client := apivideosdk.ClientBuilder("API_VIDEO_KEY").Build()
uploadTokensApi := client.UploadTokens
Endpoints
Method HTTP request Description
CreateToken Post /upload-tokens Generate an upload token
GetToken Get /upload-tokens/{uploadToken} Retrieve upload token
DeleteToken Delete /upload-tokens/{uploadToken} Delete an upload token
List Get /upload-tokens List all active upload tokens

Videos

Retrieve an instance of the Videos API:
client := apivideosdk.ClientBuilder("API_VIDEO_KEY").Build()
videosApi := client.Videos
Endpoints
Method HTTP request Description
Create Post /videos Create a video object
Upload Post /videos/{videoId}/source Upload a video
UploadWithUploadToken Post /upload Upload with an delegated upload token
Get Get /videos/{videoId} Retrieve a video object
Update Patch /videos/{videoId} Update a video object
Delete Delete /videos/{videoId} Delete a video object
List Get /videos List all video objects
UploadThumbnail Post /videos/{videoId}/thumbnail Upload a thumbnail
[PickThumbnail](https://github.com/apivideo/api.video-go-client/blob/main/docs

Extension points exported contracts — how you extend this code

TagsServiceI (Interface)
(no doc) [10 implementers]
api_tags.go
IUploadStream (Interface)
VideosService communicating with the Videos endpoints of the api.video API [2 implementers]
api_videos.go
WatermarksServiceI (Interface)
(no doc) [4 implementers]
api_watermarks.go
WebhooksServiceI (Interface)
(no doc) [4 implementers]
api_webhooks.go
ChaptersServiceI (Interface)
(no doc) [3 implementers]
api_chapters.go
CaptionsServiceI (Interface)
(no doc) [2 implementers]
api_captions.go
UploadTokensServiceI (Interface)
(no doc) [1 implementers]
api_upload_tokens.go
AnalyticsServiceI (Interface)
(no doc) [1 implementers]
api_analytics.go

Core symbols most depended-on inside this repo

parameterToString
called by 131
client.go
PtrString
called by 124
utils.go
Get
called by 68
api_videos.go
do
called by 61
client.go
prepareRequest
called by 54
client.go
PtrBool
called by 40
utils.go
Name
called by 21
api_live_streams.go
Set
called by 18
model_video_status_encoding_metadata.go

Shape

Method 2,151
Function 320
Struct 202
Interface 14

Languages

Go100%

Modules by API surface

api_videos.go127 symbols
model_video.go90 symbols
model_player_theme.go88 symbols
utils.go76 symbols
model_player_theme_update_payload.go73 symbols
model_player_theme_creation_payload.go73 symbols
model_video_creation_payload.go70 symbols
model_video_status_encoding_metadata.go63 symbols
model_video_update_payload.go61 symbols
model_live_stream.go47 symbols
model_filter_by_2.go45 symbols
model_filter_by_1.go45 symbols

For agents

$ claude mcp add api.video-go-client \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page