使用关键字搜索单个 youtube 视频

Search for single youtube video with keywords

我正在创建一个请求搜索 youtube 数据 api 使用关键字然后 return 最流行视频的视频 ID 的网络应用程序,我已经通过发送获取对“https://www.googleapis.com/youtube/v3/search”的请求,尽管我很快意识到当我的限制为 10,000 时每个搜索请求都会用掉 100 个配额,所以我的问题是,是否有其他方法可以获得我正在寻找的相同结果?如果不能,我该如何提高我的配额限制,费用是多少?

$.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 请求有 cost of 100 points,因此,如果您打算使用搜索,则需要更多配额,为此,您必须联系 YouTube 询问他们更多配额 (though, that is a paid service - which I couldn't find clear information about it)。

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