api.video Python API client
Project description
api.video Python 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.
Requirements.
Python >= 3.6
Installation
pip install api.video
Examples
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 for API Endpoints
All URIs are relative to https://ws.api.video
CaptionsApi API endpoints
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 API endpoints
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 API endpoints
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 API endpoints
Method | HTTP request | Description |
---|---|---|
delete | DELETE /players/{playerId} | Delete a player |
delete_logo | DELETE /players/{playerId}/logo | Delete logo |
list | GET /players | List all players |
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 API endpoints
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 API endpoints
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 API endpoints
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 API endpoints
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 |
Documentation For Models
- AccessToken
- Account
- AccountQuota
- 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
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.