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
- Getting started
- Documentation
- Have you gotten use from this API client?
- Contribution
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-clientCode 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.AnalyticsEndpoints
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.CaptionsEndpoints
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}/captionsList video captions Chapters
Retrieve an instance of the Chapters API:
client := apivideosdk.ClientBuilder("API_VIDEO_KEY").Build() chaptersApi := client.ChaptersEndpoints
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}/chaptersList video chapters LiveStreams
Retrieve an instance of the LiveStreams API:
client := apivideosdk.ClientBuilder("API_VIDEO_KEY").Build() liveStreamsApi := client.LiveStreamsEndpoints
Method HTTP request Description Create Post /live-streamsCreate 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-streamsList all live streams UploadThumbnail Post /live-streams/{liveStreamId}/thumbnailUpload a thumbnail DeleteThumbnail Delete /live-streams/{liveStreamId}/thumbnailDelete a thumbnail Complete Put /live-streams/{liveStreamId}/completeComplete a live stream PlayerThemes
Retrieve an instance of the PlayerThemes API:
client := apivideosdk.ClientBuilder("API_VIDEO_KEY").Build() playerThemesApi := client.PlayerThemesEndpoints
Method HTTP request Description Create Post /playersCreate 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 /playersList all player themes UploadLogo Post /players/{playerId}/logoUpload a logo DeleteLogo Delete /players/{playerId}/logoDelete logo Summaries
Retrieve an instance of the Summaries API:
client := apivideosdk.ClientBuilder("API_VIDEO_KEY").Build() summariesApi := client.SummariesEndpoints
Method HTTP request Description Create Post /summariesGenerate video summary Update Patch /summaries/{summaryId}/sourceUpdate summary details Delete Delete /summaries/{summaryId}Delete video summary List Get /summariesList summaries GetSummarySource Get /summaries/{summaryId}/sourceGet summary details Tags
Retrieve an instance of the Tags API:
client := apivideosdk.ClientBuilder("API_VIDEO_KEY").Build() tagsApi := client.TagsEndpoints
Method HTTP request Description List Get /tagsList all video tags UploadTokens
Retrieve an instance of the UploadTokens API:
client := apivideosdk.ClientBuilder("API_VIDEO_KEY").Build() uploadTokensApi := client.UploadTokensEndpoints
Method HTTP request Description CreateToken Post /upload-tokensGenerate an upload token GetToken Get /upload-tokens/{uploadToken}Retrieve upload token DeleteToken Delete /upload-tokens/{uploadToken}Delete an upload token List Get /upload-tokensList all active upload tokens Videos
Retrieve an instance of the Videos API:
client := apivideosdk.ClientBuilder("API_VIDEO_KEY").Build() videosApi := client.VideosEndpoints
Method HTTP request Description Create Post /videosCreate a video object Upload Post /videos/{videoId}/sourceUpload a video UploadWithUploadToken Post /uploadUpload 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 /videosList all video objects UploadThumbnail Post /videos/{videoId}/thumbnailUpload a thumbnail PickThumbnail Patch /videos/{videoId}/thumbnailSet a thumbnail GetDiscarded Get /discarded/videos/{videoId}Retrieve a discarded video object GetStatus Get /videos/{videoId}/statusRetrieve video status and details ListDiscarded Get /discarded/videosList all discarded video objects UpdateDiscarded Patch /discarded/videos/{videoId}Update a discarded video object Watermarks
Retrieve an instance of the Watermarks API:
client := apivideosdk.ClientBuilder("API_VIDEO_KEY").Build() watermarksApi := client.WatermarksEndpoints
Method HTTP request Description Upload Post /watermarksUpload a watermark Delete Delete /watermarks/{watermarkId}Delete a watermark List Get /watermarksList all watermarks Webhooks
Retrieve an instance of the Webhooks API:
client := apivideosdk.ClientBuilder("API_VIDEO_KEY").Build() webhooksApi := client.WebhooksEndpoints
Method HTTP request Description Create Post /webhooksCreate Webhook Get Get /webhooks/{webhookId}Retrieve Webhook details Delete Delete /webhooks/{webhookId}Delete a Webhook List Get /webhooksList all webhooks Models
- AccessToken
- AdditionalBadRequestErrors
- AnalyticsAggregatedMetricsResponse
- AnalyticsAggregatedMetricsResponseContext
- AnalyticsAggregatedMetricsResponseContextTimeframe
- AnalyticsData
- AnalyticsMetricsBreakdownResponse
- AnalyticsMetricsBreakdownResponseContext
- AnalyticsMetricsBreakdownResponseData
- AnalyticsMetricsOverTimeResponse
- AnalyticsMetricsOverTimeResponseContext
- AnalyticsMetricsOverTimeResponseData
- AnalyticsPlays400Error
- AnalyticsPlaysResponse
- AuthenticatePayload
- BadRequest
- BytesRange
- Caption
- CaptionsListResponse
- CaptionsUpdatePayload
- Chapter
- ChaptersListResponse
- ConflictError
- DiscardedVideoUpdatePayload
- FilterBy
- FilterBy1
- FilterBy2
- Link
- ListTagsResponse
- ListTagsResponseData
- LiveStream
- LiveStreamAssets
- LiveStreamCreationPayload
- LiveStreamListResponse
- LiveStreamUpdatePayload
- Metadata
- Model403ErrorSchema
- NotFound
- Pagination
- PaginationLink
- PlayerSessionEvent
- PlayerTheme
- PlayerThemeAssets
- PlayerThemeCreationPayload
- PlayerThemeUpdatePayload
- PlayerThemesListResponse
- Quality
- RefreshTokenPayload
- RestreamsRequestObject
- RestreamsResponseObject
- SummariesListResponse
- Summary
- SummaryCreationPayload
- SummarySource
- SummaryUpdatePayload
- TokenCreationPayload
- TokenListResponse
- TooManyRequests
- UnrecognizedRequestUrl
- UploadToken
- Video
- VideoAssets
- VideoClip
- VideoCreationPayload
- VideoSource
- VideoSourceLiveStream
- VideoSourceLiveStreamLink
- VideoStatus
- VideoStatusEncoding
- VideoStatusEncodingMetadata
- VideoStatusIngest
- VideoStatusIngestReceivedParts
- VideoThumbnailPickPayload
- VideoUpdatePayload
- VideoWatermark
- VideosListResponse
- Watermark
- WatermarksListResponse
- Webhook
- WebhooksCreationPayload
- WebhooksListResponse
Have you gotten use from this API client?
Please take a moment to leave a star on the client ⭐
This helps other users to find the clients and also helps us understand which clients are most popular. Thank you!
Contribution
Since this API client is generated from an OpenAPI description, we cannot accept pull requests made directly to the repository. If you want to contribute, you can open a pull request on the repository of our client generator. Otherwise, you can also simply open an issue detailing your need on this repository.
