Optidash Blog

Get Public Video Thumbnails With Fetch Endpoint

New Optidash API update: Fetch and transform thumbnails of public videos with ease. Perfect for users dealing with YouTube and user-generated content.

Today, we’ve rolled out a fresh set of features on the Optidash API, tailored to streamline the workflows of our users who frequently engage with publicly-accessible videos and user-generated content, often sourced from platforms like YouTube. Now, with our enhanced Fetch Endpoint, users can effortlessly retrieve and transform thumbnails from public videos, adding an extra layer of convenience to their daily tasks. Whether it’s curating eye-catching visuals for presentations or sprucing up content for social media, this new capability promises to simplify the process, empowering users to achieve their creative goals with greater ease.

How To Get Video Thumbnails

To take advantage of this exciting new feature, simply tweak the image URL provided in your Optidash API Image Fetch request. The format for fetching thumbnails of public videos follows the pattern outlet:video_id. For instance, if you wish to fetch and transform the thumbnail image of a YouTube video identified by the ID dQw4w9WgXcQ, you’d use youtube:dQw4w9WgXcQ as the url parameter in the fetch parameters.

These thumbnails can then be effortlessly customized using the comprehensive suite of high-precision operations offered by the Optidash API. Let’s say you want to retrieve a thumbnail from a YouTube video with the ID a6bBbTWgxCU, resize it to a maximum width of 720 pixels, enhance sharpness with an unsharp mask, and subtly boost saturation. Here’s how you’d structure a cURL request to achieve this:

curl https://api.optidash.ai/1.0/fetch -X POST -u your-api-key: \
-H "Content-Type: application/json" \
-d '{
    "url": "youtube:a6bBbTWgxCU",
    "resize": {
        "width": 720
    },
    "adjust": {
        "unsharp": 1.5,
        "saturation": 5.5
    }
}'

Quick Example

Here’s a quick example of said operation implemented with our official Node integration:

const Optidash = require("optidash");

/**
* Instantiate `opti`
*/

const opti = new Optidash("your-api-key");

/**
* Fetch thumbnail of YouTube's video `a6bBbTWgxCU`
* resize it to a maximum width of 720 pixels width,
* and adjust sharpness (1.5) and saturation (5.5)
*/

opti
    .fetch("youtube:a6bBbTWgxCU")
    .resize({
        width: 720
    })
    .adjust({
        unsharp: 1.5,
        saturation: 5.5
    })
    .toJSON((err, meta) => {
        if (err) {
            return console.log(err);
        }
    });

Wrapping Up

We’re excited to announce that our support now extends to YouTube, Vimeo, and Dailymotion outlets, with plans to add more in the future. For complete details, be sure to review the updated API documentation for Thumbnails of Public Videos.

If you have any questions about the Fetch endpoint or suggestions for additional features, do not hesitate to reach out to us. We’re here to help!