api.video Python API client
Project description
api.video Python 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
- Table of contents
- Project description
- Getting started
- Documentation
- Have you gotten use from this API client?
- Contribution
Project description
api.video's Python API client streamlines the coding process. Chunking files is handled for you, as is pagination and refreshing your tokens.
Getting started
Requirements
Python >= 3.6
Installation
pip install api.video
Code samples
Automatic authentication
list all videos:
import apivideo
from apivideo.apis import VideosApi
api_key = "__API_KEY__"
with apivideo.AuthenticatedApiClient(api_key) as client:
# if you rather like to use the sandbox environment:
# with apivideo.AuthenticatedApiClient(api_key, production=False) as client:
videos_api = VideosApi(client)
videos = videos_api.list()
In this context the client will keep its authentication updated.
Manual authentication
If there is an issue, like you think a refresh token may have been exposed, you can manually retrieve a new one. Otherwise, authentication is handled for you. When you retrieve a new refresh token, the old one becomes invalid. Here is the code, where you retrieve a list of videos and then refresh your token:
import apivideo
from apivideo.apis import VideosApi
from apivideo.exceptions import ApiAuthException
api_key = "__API_KEY__"
client = apivideo.AuthenticatedApiClient(api_key)
# if you rather like to use the sandbox environment:
# client = apivideo.AuthenticatedApiClient(api_key, production=False)
client.connect()
videos_api = VideosApi(client)
videos = videos_api.list()
try:
client.refresh_token()
except ApiAuthException:
print("cannot refresh token !")
...
Documentation
API Endpoints
All URIs are relative to https://ws.api.video
CaptionsApi
Method | HTTP request | Description |
---|---|---|
delete | DELETE /videos/{videoId}/captions/{language} | Delete a caption |
list | GET /videos/{videoId}/captions | List video captions |
get | GET /videos/{videoId}/captions/{language} | Show a caption |
update | PATCH /videos/{videoId}/captions/{language} | Update caption |
upload | POST /videos/{videoId}/captions/{language} | Upload a caption |
ChaptersApi
Method | HTTP request | Description |
---|---|---|
delete | DELETE /videos/{videoId}/chapters/{language} | Delete a chapter |
list | GET /videos/{videoId}/chapters | List video chapters |
get | GET /videos/{videoId}/chapters/{language} | Show a chapter |
upload | POST /videos/{videoId}/chapters/{language} | Upload a chapter |
LiveStreamsApi
Method | HTTP request | Description |
---|---|---|
delete | DELETE /live-streams/{liveStreamId} | Delete a live stream |
delete_thumbnail | DELETE /live-streams/{liveStreamId}/thumbnail | Delete a thumbnail |
list | GET /live-streams | List all live streams |
get | GET /live-streams/{liveStreamId} | Show live stream |
update | PATCH /live-streams/{liveStreamId} | Update a live stream |
create | POST /live-streams | Create live stream |
upload_thumbnail | POST /live-streams/{liveStreamId}/thumbnail | Upload a thumbnail |
PlayerThemesApi
Method | HTTP request | Description |
---|---|---|
delete | DELETE /players/{playerId} | Delete a player |
delete_logo | DELETE /players/{playerId}/logo | Delete logo |
list | GET /players | List all player themes |
get | GET /players/{playerId} | Show a player |
update | PATCH /players/{playerId} | Update a player |
create | POST /players | Create a player |
upload_logo | POST /players/{playerId}/logo | Upload a logo |
RawStatisticsApi
Method | HTTP request | Description |
---|---|---|
list_live_stream_sessions | GET /analytics/live-streams/{liveStreamId} | List live stream player sessions |
list_session_events | GET /analytics/sessions/{sessionId}/events | List player session events |
list_video_sessions | GET /analytics/videos/{videoId} | List video player sessions |
UploadTokensApi
Method | HTTP request | Description |
---|---|---|
delete_token | DELETE /upload-tokens/{uploadToken} | Delete an upload token |
list | GET /upload-tokens | List all active upload tokens. |
get_token | GET /upload-tokens/{uploadToken} | Show upload token |
create_token | POST /upload-tokens | Generate an upload token |
VideosApi
Method | HTTP request | Description |
---|---|---|
delete | DELETE /videos/{videoId} | Delete a video |
get | GET /videos/{videoId} | Show a video |
get_status | GET /videos/{videoId}/status | Show video status |
list | GET /videos | List all videos |
update | PATCH /videos/{videoId} | Update a video |
pick_thumbnail | PATCH /videos/{videoId}/thumbnail | Pick a thumbnail |
upload_with_upload_token | POST /upload | Upload with an upload token |
create | POST /videos | Create a video |
upload | POST /videos/{videoId}/source | Upload a video |
upload_thumbnail | POST /videos/{videoId}/thumbnail | Upload a thumbnail |
WebhooksApi
Method | HTTP request | Description |
---|---|---|
delete | DELETE /webhooks/{webhookId} | Delete a Webhook |
get | GET /webhooks/{webhookId} | Show Webhook details |
list | GET /webhooks | List all webhooks |
create | POST /webhooks | Create Webhook |
Models
- AccessToken
- AuthenticatePayload
- BadRequest
- BytesRange
- Caption
- CaptionsListResponse
- CaptionsUpdatePayload
- Chapter
- ChaptersListResponse
- Link
- LiveStream
- LiveStreamAssets
- LiveStreamCreationPayload
- LiveStreamListResponse
- LiveStreamSession
- LiveStreamSessionClient
- LiveStreamSessionDevice
- LiveStreamSessionLocation
- LiveStreamSessionReferrer
- LiveStreamSessionSession
- LiveStreamUpdatePayload
- Metadata
- NotFound
- Pagination
- PaginationLink
- PlayerSessionEvent
- PlayerTheme
- PlayerThemeAssets
- PlayerThemeCreationPayload
- PlayerThemeUpdatePayload
- PlayerThemesListResponse
- Quality
- RawStatisticsListLiveStreamAnalyticsResponse
- RawStatisticsListPlayerSessionEventsResponse
- RawStatisticsListSessionsResponse
- RefreshTokenPayload
- TokenCreationPayload
- TokenListResponse
- UploadToken
- Video
- VideoAssets
- VideoCreationPayload
- VideoSession
- VideoSessionClient
- VideoSessionDevice
- VideoSessionLocation
- VideoSessionOs
- VideoSessionReferrer
- VideoSessionSession
- VideoSource
- VideoSourceLiveStream
- VideoSourceLiveStreamLink
- VideoStatus
- VideoStatusEncoding
- VideoStatusEncodingMetadata
- VideoStatusIngest
- VideoThumbnailPickPayload
- VideoUpdatePayload
- VideosListResponse
- 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.