英文:
YouTube search for any query cost 100 queries?
问题
在这个页面上看到 -
https://developers.google.com/youtube/v3/determine_quota_cost
在"search"功能下,我看到每次使用需要100个查询。我不知道"search"是否指的是端点中的q
查询参数,这就是我想要弄清楚的。当我在我的应用中使用以下网络调用时 -
interface YoutubeApi {
const val BASE_URL = "https://youtube.googleapis.com/"
@GET("youtube/v3/search?part=snippet&maxResults=3")
suspend fun searchYoutubeVideos(
@Query("q") searchQuery : String,
@Query("key") apiKey : String
) : NetworkResponse<YoutubeSearchResultModel,String>
}
无论我只请求3个对象,我的调用总是需要100个查询,这相当昂贵。我是不是做错了什么,还是这就是YouTube API中每次搜索的价格?
英文:
Looking by this page -
https://developers.google.com/youtube/v3/determine_quota_cost
Under the "search" function I see that it costs 100 queries per use. I don't know if "search" means the q
query parameter in the endpoint, and this is why I am trying to figure out. When I am using the following network call in my app -
interface YoutubeApi {
const val BASE_URL = "https://youtube.googleapis.com/"
@GET("youtube/v3/search?part=snippet&maxResults=3")
suspend fun searchYoutubeVideos(
@Query("q") searchQuery : String,
@Query("key") apiKey : String
) : NetworkResponse<YoutubeSearchResultModel,String>
}
My call always results in costing 100 queries, regardless of me asking only for 3 objects, which is pretty expensive. Am I doing something wrong or this is how it works and this is the price for each search in the YouTube API?
答案1
得分: 1
YouTube Data API v3 Search: list endpoint is very expensive, consider applying for quota extension.
英文:
YouTube Data API v3 Search: list endpoint is very expensive, consider applying for quota extension.
答案2
得分: 1
抱歉,maxResults
与配额成本无关。正如他们的文档清楚说明的那样,它始终是100个点,不管每页的结果数量如何。此外,每次请求下一页时,每个后续调用本身都会消耗100个点(一次单一搜索,3页结果,300个点)。
英文:
Sadly, maxResults
is not connected with quota cost. It's always 100 points, as clearly stated in their docs, regardless of the number of results per page.
Also, every subsequent call while requesting the next page has a cost of 100 points itself (one single search, 3 pages of results, 300 points)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论