问题
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)
})
回答1:
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
).
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.
来源:https://stackoverflow.com/questions/56443166/search-for-single-youtube-video-with-keywords