Meet YouTube SERP API! 3 Ways To Collect Data For Competitor Research On YouTube – DataForSEO


22 Dec

YouTube is the world’s second-most used social media platform according to Digital 2022: Global Overview Report. In total, YouTube gets 14.3 billion visits per month and has 368 million active app users daily.

With 720,000 hours of fresh video content per day, it becomes hard work to stay noticed. No wonder improving video visibility is the main objective for many creators.

While building a strategy for any business, you must determine your segment and keep an eye on your competitors to analyze your effectiveness and the way you should move. Running a YouTube channel is no less difficult. After all, your subscribers are the “customers” who pay with their time.

With our new product, you can build a strong tool for YouTube and get your customers’ competitor research to a new level.

Let us introduce you to the brand-new YouTube API!

YouTube API will become your ultimate source of any kind of video and channel data. Using its endpoints, you can find various solutions that will develop your YouTube tool with new features for market analysis.

In the following paragraphs, we will take you through three steps to improve your competitor research with YouTube API. But first, let us briefly describe the new endpoints.

All data in four endpoints

1 The YouTube Organic endpoint returns a list of video rankings for a specific keyword on YouTube. You will also obtain additional information on each video item: its ID, title, channel where it is published, description, and other data.

2 Using the YouTube Video Info endpoint, you will receive a list of information on the specified YouTube video. You will be able to discover all the information available in YouTube Organic video items in addition to views, likes and comments count, keywords, category, streaming quality, and more.

3 The YouTube Subtitles endpoint can give you in-depth information on the subtitles in the video you specify. It provides all text with its timing, duration, and other data in multiple languages.

4 With the YouTube Comments endpoint, you can get a list of top comments on the YouTube video you specify. Along with the text of the comment, information about the author, likes and replies count, and other relevant data.

Now that you know what data the new endpoints provide, it’s about time we demonstrate how to use them in practice.

Get top-ranked videos

In the modern world, trends are changing quickly, so you can easily lose your place among competitors. If you create a new YouTube channel or want to upload a video on a new trending theme, be sure to research your audience’s interests first. The best way to do this is to monitor video rankings on YouTube SERP.

DataForSEO Youtube Organic endpoint will help you get top-ranked videos for any keyword you specify. Let’s take a look at an example:

Imagine you run a Youtube channel whose main category is music. You want to make a review of a new Taylor Swift album so people may find your video by typing “taylor swift new album review”, “midnights review” or any combination of these keywords. To understand trending videos depending on the language and location of your audience you can make a POST request to YouTube Organic endpoint containing these parameters and any keyword you are interested in.

Your request should be structured like this:

[
  {
    "language_code": "en",
    "location_code": 2840,
    "keyword": "midnights review"
  }
]

In the API response you will get:

{
  "version": "0.1.20220819",
  "status_code": 20000,
  "status_message": "Ok.",
  "time": "4.0915 sec.",
  "cost": 0.002,
  "tasks_count": 1,
  "tasks_error": 0,
  "tasks": [
    {
      "id": "12121808-4426-0139-0000-d2038fdc7f99",
      "status_code": 20000,
      "status_message": "Ok.",
      "time": "4.0305 sec.",
      "cost": 0.002,
      "result_count": 1,
      "path": [
        "v3",
        "serp",
        "youtube",
        "organic",
        "live",
        "advanced"
      ],
      "data": {
        "api": "serp",
        "function": "live",
        "se": "youtube",
        "se_type": "organic",
        "language_code": "en",
        "location_code": 2840,
        "keyword": "midnights review",
        "device": "desktop",
        "os": "windows"
      },
      "result": [
        {
          "keyword": "midnights review",
          "se_domain": "youtube.com",
          "location_code": 2840,
          "language_code": "en",
          "check_url": "
          "datetime": "2022-12-12 16:08:07 +00:00",
          "spell": null,
          "item_types": [
            "youtube_video"
          ],
          "se_results_count": 135693,
          "items_count": 54,
          "items": [
            {
              "type": "youtube_video",
              "rank_group": 1,
              "rank_absolute": 1,
              "block_rank": 1,
              "block_name": null,
              "title": "Taylor Swift - Midnights ALBUM REVIEW",
              "url": "
              "video_id": "8vmm8x_Cq4s",
              "thumbnail_url": "
              "channel_id": "UCt7fwAhXDy3oNFTAzF2o8Pw",
              "channel_name": "theneedledrop",
              "channel_url": "
              "channel_logo": "
              "description": "Taylor's middest album since Reputation. More pop reviews : ...",
              "highlighted": [
                "reviews"
              ],
              "badges": null,
              "is_live": false,
              "is_shorts": false,
              "views_count": 437717,
              "publication_date": "1 month ago",
              "timestamp": "2022-11-12 16:08:06 +00:00",
              "duration_time": "6:36",
              "duration_time_seconds": 396
            },
            {
              "type": "youtube_video",
              "rank_group": 2,
              "rank_absolute": 2,
              "block_rank": 1,
              "block_name": null,
              "title": "Midnights Review & Ranking all SONGS !",
              "url": "
              "video_id": "GkceG4lMgBo",
              "thumbnail_url": "
              "channel_id": "UCB7hShJn8L-6f6VKq_deKyw",
              "channel_name": "Chats & Reacts",
              "channel_url": "
              "channel_logo": "
              "description": "CONTACT - [email protected] Hello and welcome to this weird crevasse of the internet where we get really excited ...",
              "highlighted": null,
              "badges": null,
              "is_live": false,
              "is_shorts": false,
              "views_count": 159760,
              "publication_date": "3 weeks ago",
              "timestamp": "2022-11-21 16:08:06 +00:00",
              "duration_time": "1:08:30",
              "duration_time_seconds": 4110
            },
            {
              "type": "youtube_video",
              "rank_group": 3,
              "rank_absolute": 3,
              "block_rank": 1,
              "block_name": null,
              "title": "Taylor Swift's Midnights: Album Deep Dive🕯✨ Analysis and thoughts from an OG Swiftie",
              "url": "
              "video_id": "ph85LAtLkuw",
              "thumbnail_url": "
              "channel_id": "UCZIAukByCFgl2GgQmNtJlHQ",
              "channel_name": "Ally Sheehan",
              "channel_url": "
              "channel_logo": "
              "description": "LET'S TAKE A DEEP DIVE INTO MIDNIGHTS ! Every easter egg I found, reference to past songs and lovers, and insight from a ...",
              "highlighted": [
                "MIDNIGHTS"
              ],
              "badges": null,
              "is_live": false,
              "is_shorts": false,
              "views_count": 30734,
              "publication_date": "10 days ago",
              "timestamp": "2022-12-02 16:08:06 +00:00",
              "duration_time": "1:04:40",
              "duration_time_seconds": 3880
            }
          ]
        }
      ]
    }
  ]
}

Note that the YouTube search engine forms results into blocks. Here you can see the block_name field, which shows the name of the block, for example, “Channels new to you”, and the block_rank, which indicates the position of the block in SERP. The default block_depth value is 20.

After you receive YouTube SERP, we recommend you to check all possible keywords to create a base of your main competitors on each of them and then analyze which theme will work best for your video.

Examine video data and keyword ideas

It is a great thing to know the competition, but it’s not enough to get on top of trends. YouTube algorithms consider a large number of metrics when displaying a SERP on your request. Besides likes and comments, search results are influenced by keywords in the title and description, category, streaming quality, and other parameters. To understand how to beat your competitors, first research their video data.

Getting back to your new video review of Taylor Swift’s album, you want to see why the top-ranked video is considered the best. The YouTube Video Info endpoint will give you all available information about the video and the channel where it is published.

To set a task you will need a video_id parameter that you can find in the response of the YouTube Organic endpoint, which was displayed in the previous part.

You also could find it in the URL of the video.

Your request should be structured like this:

[
  {
    "language_code": "en",
    "location_code": 2840,
    "video_id": "8vmm8x_Cq4s"
  }
]

In the API response you will get:

{
  "version": "0.1.20220819",
  "status_code": 20000,
  "status_message": "Ok.",
  "time": "19.1243 sec.",
  "cost": 0.006,
  "tasks_count": 1,
  "tasks_error": 0,
  "tasks": [
    {
      "id": "12121816-4426-0139-0000-3d978b854ffd",
      "status_code": 20000,
      "status_message": "Ok.",
      "time": "19.0498 sec.",
      "cost": 0.006,
      "result_count": 1,
      "path": [
        "v3",
        "serp",
        "youtube",
        "video_info",
        "live",
        "advanced"
      ],
      "data": {
        "api": "serp",
        "function": "live",
        "se": "youtube",
        "se_type": "video_info",
        "language_code": "en",
        "location_code": 2840,
        "video_id": "8vmm8x_Cq4s",
        "device": "desktop",
        "os": "windows"
      },
      "result": [
        {
          "video_id": "8vmm8x_Cq4s",
          "se_domain": "youtube.com",
          "location_code": 2840,
          "language_code": "en",
          "check_url": "
          "datetime": "2022-12-12 16:17:15 +00:00",
          "spell": null,
          "item_types": [
            "youtube_video_info"
          ],
          "items_count": 1,
          "items": [
            {
              "type": "youtube_video_info",
              "rank_group": 1,
              "rank_absolute": 1,
              "video_id": "8vmm8x_Cq4s",
              "title": "Taylor Swift - Midnights ALBUM REVIEW",
              "url": "
              "thumbnail_url": "
              "channel_id": "UCt7fwAhXDy3oNFTAzF2o8Pw",
              "channel_name": "theneedledrop",
              "channel_url": "
              "channel_logo": "
              "description": "Listen:  middest album since Reputation.\n\nMore pop reviews:    site:     Twitch:  TRACKS: ANTI-HERO, SNOW ON THE BEACH, LABYRINTH, SWEET NOTHING\n\nLEAST FAV TRACK: VIGILANTE SHIT\n\nTAYLOR SWIFT - MIDNIGHTS / 2022 / REPUBLIC / SYNTHPOP\n\n5/10\n\nY'all know this is just my opinion, right?",
              "views_count": 437717,
              "likes_count": 0,
              "comments_count": 2200,
              "publication_date": "Oct 26, 2022",
              "timestamp": "2022-10-26 00:00:00 +00:00",
              "keywords": [
                "album",
                "review",
                "music",
                "reviews",
                "indie",
                "new",
                "lyrics",
                "listen",
                "track",
                "concert",
                "live",
                "update",
                "the needle drop",
                "anthony fantano",
                "vlog",
                "talk",
                "discussion",
                "music nerd",
                "song",
                "jack antonoff",
                "synth",
                "pop"
              ],
              "category": "Music",
              "is_live": false,
              "duration_time": "06:36",
              "duration_time_seconds": 396,
              "subtitles": "Array",
              "streaming_quality": [
                {
                  "type": "streaming_quality_element",
                  "label": "1080p",
                  "width": 1920,
                  "height": 1080,
                  "bitrate": 2187688,
                  "mime_type": "video/mp4; codecs=\"avc1.640028\"",
                  "fps": 30
                },
                {
                  "type": "streaming_quality_element",
                  "label": "1080p",
                  "width": 1920,
                  "height": 1080,
                  "bitrate": 2057412,
                  "mime_type": "video/webm; codecs=\"vp9\"",
                  "fps": 30
                },
                {
                  "type": "streaming_quality_element",
                  "label": "1080p",
                  "width": 1920,
                  "height": 1080,
                  "bitrate": 1641832,
                  "mime_type": "video/mp4; codecs=\"av01.0.08M.08\"",
                  "fps": 30
                },
                {
                  "type": "streaming_quality_element",
                  "label": "720p",
                  "width": 1280,
                  "height": 720,
                  "bitrate": 464327,
                  "mime_type": "video/mp4; codecs=\"avc1.64001F, mp4a.40.2\"",
                  "fps": 30
                },
                {
                  "type": "streaming_quality_element",
                  "label": "720p",
                  "width": 1280,
                  "height": 720,
                  "bitrate": 597793,
                  "mime_type": "video/mp4; codecs=\"avc1.4d401f\"",
                  "fps": 30
                },
                {
                  "type": "streaming_quality_element",
                  "label": "720p",
                  "width": 1280,
                  "height": 720,
                  "bitrate": 673545,
                  "mime_type": "video/webm; codecs=\"vp9\"",
                  "fps": 30
                },
                {
                  "type": "streaming_quality_element",
                  "label": "720p",
                  "width": 1280,
                  "height": 720,
                  "bitrate": 913238,
                  "mime_type": "video/mp4; codecs=\"av01.0.05M.08\"",
                  "fps": 30
                },
                {
                  "type": "streaming_quality_element",
                  "label": "480p",
                  "width": 854,
                  "height": 480,
                  "bitrate": 341037,
                  "mime_type": "video/mp4; codecs=\"avc1.4d401f\"",
                  "fps": 30
                },
                {
                  "type": "streaming_quality_element",
                  "label": "480p",
                  "width": 854,
                  "height": 480,
                  "bitrate": 443699,
                  "mime_type": "video/webm; codecs=\"vp9\"",
                  "fps": 30
                },
                {
                  "type": "streaming_quality_element",
                  "label": "480p",
                  "width": 854,
                  "height": 480,
                  "bitrate": 478037,
                  "mime_type": "video/mp4; codecs=\"av01.0.04M.08\"",
                  "fps": 30
                },
                {
                  "type": "streaming_quality_element",
                  "label": "360p",
                  "width": 640,
                  "height": 360,
                  "bitrate": 437561,
                  "mime_type": "video/mp4; codecs=\"avc1.42001E, mp4a.40.2\"",
                  "fps": 30
                },
                {
                  "type": "streaming_quality_element",
                  "label": "360p",
                  "width": 640,
                  "height": 360,
                  "bitrate": 235367,
                  "mime_type": "video/mp4; codecs=\"avc1.4d401e\"",
                  "fps": 30
                },
                {
                  "type": "streaming_quality_element",
                  "label": "360p",
                  "width": 640,
                  "height": 360,
                  "bitrate": 294882,
                  "mime_type": "video/webm; codecs=\"vp9\"",
                  "fps": 30
                },
                {
                  "type": "streaming_quality_element",
                  "label": "360p",
                  "width": 640,
                  "height": 360,
                  "bitrate": 288163,
                  "mime_type": "video/mp4; codecs=\"av01.0.01M.08\"",
                  "fps": 30
                },
                {
                  "type": "streaming_quality_element",
                  "label": "240p",
                  "width": 426,
                  "height": 240,
                  "bitrate": 133815,
                  "mime_type": "video/mp4; codecs=\"avc1.4d4015\"",
                  "fps": 30
                },
                {
                  "type": "streaming_quality_element",
                  "label": "240p",
                  "width": 426,
                  "height": 240,
                  "bitrate": 178049,
                  "mime_type": "video/webm; codecs=\"vp9\"",
                  "fps": 30
                },
                {
                  "type": "streaming_quality_element",
                  "label": "240p",
                  "width": 426,
                  "height": 240,
                  "bitrate": 152261,
                  "mime_type": "video/mp4; codecs=\"av01.0.00M.08\"",
                  "fps": 30
                },
                {
                  "type": "streaming_quality_element",
                  "label": "144p",
                  "width": 256,
                  "height": 144,
                  "bitrate": 85410,
                  "mime_type": "video/mp4; codecs=\"avc1.4d400c\"",
                  "fps": 30
                },
                {
                  "type": "streaming_quality_element",
                  "label": "144p",
                  "width": 256,
                  "height": 144,
                  "bitrate": 95909,
                  "mime_type": "video/webm; codecs=\"vp9\"",
                  "fps": 30
                },
                {
                  "type": "streaming_quality_element",
                  "label": "144p",
                  "width": 256,
                  "height": 144,
                  "bitrate": 76944,
                  "mime_type": "video/mp4; codecs=\"av01.0.00M.08\"",
                  "fps": 30
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

Besides information about the description, the number of views and likes, the thumbnail, and the logo, you get a list of keywords relevant to the video.

This will help you to analyze what words in the title and description will influence your video ranking and give you valuable keyword ideas.

In addition to that, you can get a list of top comments under the video by using the YouTube Comments endpoint. The structure of the request is the same as in YouTube Video Info. You will be able to discover the text of the comment, information about the author, comment metrics, and other relevant data.

Retrieve subtitles from the video

To get the text from the video is a popular request. You can use it in a variety of ways, such as teaching virtual assistants like Siri, Alexa, etc. For YouTube content creators it is an opportunity to analyze different texts and create a video with unique information.

Imagine that you are doing research for your new video review of Taylor Swift’s album. You want to collect the subtitles in top-ranked videos to find out what information is in there. DataForSEO YouTube Subtitles endpoint will give you subtitled text with its timing and duration in the video in different languages.

In this example, we will show how to get Spanish subtitles from the same top-ranked review of Taylor Swift’s album.
Your request should be structured like this:

[
  {
    "language_code": "en",
    "location_code": 2840,
    "video_id": "8vmm8x_Cq4s",
    "subtitles_language": "en",
    "subtitles_translate_language": "es"
  }
]

In the API response you will get:

{
  "version": "0.1.20220819",
  "status_code": 20000,
  "status_message": "Ok.",
  "time": "9.0932 sec.",
  "cost": 0.006,
  "tasks_count": 1,
  "tasks_error": 0,
  "tasks": [
    {
      "id": "12141258-1535-0139-0000-c231b0e6e3d8",
      "status_code": 20000,
      "status_message": "Ok.",
      "time": "9.0401 sec.",
      "cost": 0.006,
      "result_count": 1,
      "path": [
        "v3",
        "serp",
        "youtube",
        "video_subtitles",
        "live",
        "advanced"
      ],
      "data": {
        "api": "serp",
        "function": "live",
        "se": "youtube",
        "se_type": "video_subtitles",
        "language_code": "en",
        "location_code": 2840,
        "video_id": "8vmm8x_Cq4s",
        "subtitles_language": "en",
        "subtitles_translate_language": "es",
        "device": "desktop",
        "os": "windows"
      },
      "result": [
        {
          "video_id": "8vmm8x_Cq4s",
          "se_domain": "youtube.com",
          "location_code": 2840,
          "language_code": "en",
          "check_url": "
          "datetime": "2022-12-14 10:58:35 +00:00",
          "spell": null,
          "item_types": [
            "youtube_subtitles"
          ],
          "unsupported_language": false,
          "translate_language": "es",
          "origin_language": "en",
          "category": "Music",
          "subtitles_count": 177,
          "title": "Taylor Swift - Midnights ALBUM REVIEW",
          "items_count": 177,
          "items": [
            {
              "type": "youtube_subtitles",
              "rank_group": 1,
              "rank_absolute": 1,
              "text": "eso va hola a todos Bethany va Tano",
              "start_time": 0,
              "end_time": 4.8,
              "duration_time": 4.799
            },
            {
              "type": "youtube_subtitles",
              "rank_group": 2,
              "rank_absolute": 2,
              "text": "aquí el nerd de la música más ocupado de Internet",
              "start_time": 3,
              "end_time": 6.66,
              "duration_time": 3.66
            },
            {
              "type": "youtube_subtitles",
              "rank_group": 3,
              "rank_absolute": 3,
              "text": "y es hora de una revisión de este nuevo",
              "start_time": 4.799,
              "end_time": 9.18,
              "duration_time": 4.38
            },
            {
              "type": "youtube_subtitles",
              "rank_group": 4,
              "rank_absolute": 4,
              "text": "álbum de Taylor Swift medianoches este es un",
              "start_time": 6.66,
              "end_time": 11.82,
              "duration_time": 5.16
            },
            {
              "type": "youtube_subtitles",
              "rank_group": 5,
              "rank_absolute": 5,
              "text": "nuevo LP de la cantante y compositora",
              "start_time": 9.179,
              "end_time": 14.1,
              "duration_time": 4.92
            }
          ]
        }
      ]
    }
  ]
}

Subtitled text from the video with exact timing gives you a better understanding of its meaning. Adding this feature to your tool will expand your customers’ opportunities during research, and help them get any information they need without wasting any time.

Cost of collecting data with YouTube API

There are four factors that determine the cost of collecting data with YouTube API: the number of results you want to collect, the endpoint you will be using, the task execution method, and priority.

Let us explain a little more about the number of results in the endpoints. The YouTube search engine forms results into blocks. For example, “People also watched”, “Channels new to you”, etc. Using the YouTube Organic API you will be billed for each SERP containing up to 20 blocks. You can specify a block_depth parameter in the POST request. The YouTube Comments endpoint has the same principle – you pay for every 20 comments.

Using the YouTube Video Info API and YouTube Subtitles API you will be charged for every result. To calculate the cost of the result, multiply the price of SERP by 3. In this case, the price will depend only on the task execution method, and priority.

API has two main methods to deliver results – Standard and Live. The Standard method supports two task priorities – Normal and High. Chosen method and priority will determine the task execution time in frames from instant results to a guaranteed turnaround time of up to 45 minutes.

Now let’s describe the cost of using the endpoints.

Organic and Comments

In both the YouTube Organic and Comments endpoints, you will be charged per every 20 blocks.

Method and priority Price per 20 blocks Price per 1M blocks
Live $0.002 $100
Standard Normal $0.0006 $30
Standard High $0.0012 $60

Note that our system processes 20 blocks in a row, so we recommend setting the depth in the multiples of 20. If you specify "depth": 21, you will be charged as per 40 results.

Video Info and Subtitles

In both the YouTube Video Info and Subtitles endpoints, you will be charged per every result.

Method and priority Price per 1 result Price per 1M results
Live $0.006 $6000
Standard Normal $0.0018 $1800
Standard High $0.0036 $3600

Conclusion

YouTube API is a reliable source of all YouTube videos and channel data. Using its endpoints, you can make three steps to improve your customers’ competitor research:

1 Get top-ranked videos. YouTube Organic endpoint provides you with a list of top-ranked videos on any keyword you specify. You can realize your audience’s preferences, check all possible keywords to create a base of your main competitors, and analyze which theme will work best for your video.
2 Examine video data and keyword ideas. YouTube Video Info endpoint will give you all possible information about the video and the channel where it is published. Besides information about key video metrics and more data, you get a list of keywords relevant to the video. You will understand what influences your video ranking and get keyword ideas.
3 Retrieve subtitles from the video. YouTube Subtitles endpoint will give you subtitled text with its timing and other relevant data in different languages. You will have a better understanding of the meaning of your competitors’ videos.

Create your own solutions and build a powerful YouTube tool using DataForSEO YouTube SERP API.


Source link

Leave a Reply

Your email address will not be published.

Recent Posts

Categories