使用关键字搜索单个 YouTube 视频 [英] Search for single youtube video with keywords

查看:42
本文介绍了使用关键字搜索单个 YouTube 视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个 Web 应用程序,该应用程序请求使用关键字搜索 youtube 数据 api,然后返回最受欢迎视频的视频 ID,我通过向 'https://www.googleapis.com/youtube/v3/search' 虽然我很快意识到每次搜索当我的限制为 10,000 时,请求使用了 100 个配额,所以我的问题是,是否有其他方法可以获得我正在寻找的相同结果?如果不能,我该如何提高配额限制?费用是多少?

I am creating a web app that requests a search to the youtube data api using keyword to then return the video id of the most popular video, i have successfully done this by sending a get request to 'https://www.googleapis.com/youtube/v3/search' although i then soon realised that each search request uses up 100 quotas when i have a limit of 10,000 so my question is, is is there an alternative method to get the same result im looking for? and if not how can i increase my quotas limit and how much will it cost?

$.get("https://www.googleapis.com/youtube/v3/search", {
        part: 'snippet',
        q: (title + " by " + artist),
        type: 'video',
        maxResults: 1,
        key: '******************'
    },
    function(data) {
        console.log(data.items[0].id.videoId)
    })

推荐答案

search 请求有一个 费用为 100 点,因此,如果您打算使用搜索,则需要更多配额,为此,您必须联系 YouTube 要求他们提供更多配额(虽然,这是一项付费服务​​ - 我找不到关于它的明确信息).

The search request has a cost of 100 points, so, if you're planning using the search, you'll need more quota, and for that, you have to contact YouTube for ask them more quota (though, that is a paid service - which I couldn't find clear information about it).

我只是在这里猜测,但是,如果配额有问题,请尝试使用其他工具,例如 Google 自定义搜索 API 或其他可让您在 YouTube 上搜索视频的工具.

I'm just guessing here, but, if the quota is a problem, try using other tool, like Google Custom Search API or other tool that lets you search for videos on YouTube.

这篇关于使用关键字搜索单个 YouTube 视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆