Basic authentication

Introduction

When authenticating your API requests on api.video without an API client, we recommend you use basic authentication over the advanced authentication method.
Basic auth saves you from having to call our dedicated advanced authentication endpoint which requires you to refresh your access tokens at regular intervals.

📘

If you are already using of our API clients, you shouldn’t worry about authenticating your API requests, as the client handles this automatically.

Retrieve your API key

Before using our API, you need to create a paid or free account.

Once you are logged in to dashboard.api.video, select the environment of your choice (sandbox or production), and copy your API key:

20002000

Example of a basic authentication request

Let’s start learning about authenticating requests with the example below. We will authenticate to make an API call to list our videos.
API request

curl -u your_api_key: https://ws.api.video/videos

📘

Notes

  • Replace “your_api_key” with the key you have already copied from https://dashboard.api.video
  • ⚠️ Important: You need to keep the semicolon after your_api_key
  • The above API request is equivalent to
    curl --header 'Authorization: Basic your_api_key_with_trailing_semicolon_in_base64' https://ws.api.video/videos

API response

{
    "data": [
        {
            "videoId": "vi4blUQJFrYWbaG44NChkH27",
            "title": "Maths video",
            // ...
        },
        {
            "videoId": "vi4blUQJFrYWbaG44NChkH27",
            "title": "Video Title",
            // ...
        }
    ]
}

That's it! You just managed to authenticate your API request to list videos.

👍

Advanced authentication

If you want to protect the access to your API key through token-based temporary access, you can also use our advanced authentication