I would like to be able to query for a YouTube video ID
using the YouTube Data API. My application only requires the ID
(and no other metadata) from the video. According to the documentation:
A simple read operation that only retrieves the ID of each returned resource has a cost of approximately 1 unit.
So I should only be charged 1 unit for a query if the ID
is exclusively returned. Using the following query, I am charged 100 units towards my quota (which I understand is the Search API quota cost)..why is there a discrepancy in the docs, what am I missing?
const response = await youtube.search.list({
"part": "id",
"maxResults": 1,
"q": "san holo honest",
"fields": "items/id/videoId"
});
The API returns:
"data": {
"items": [
{
"id": {
"videoId": "CHH48NKPAkk"
}
}
]
},
I guess I am a little confused in the difference between what the Overview page claims is a cost of 1 Unit compared to what the Search page claims is a cost of 100 Units.
I found a StackOverflow post claiming that they were able to reduce the quota count for a simple operation using a similar method to return videos IDs: Reaching quota too soon on Youtube Data API V3 - optimizing search.list
However, I can't seem to replicate. Is there a better way to query for just the video ID
so that I don't incur such a large quota fee?