YouTube কীভাবে Short-এর জন্য ভিউ গণনা করে তা মেলাতে আমরা Data API আপডেট করছি।
আরও জানুন
বাস্তবায়ন: পৃষ্ঠা সংখ্যা
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
নিচের উদাহরণটি দেখায় কিভাবে YouTube Data API (v3) প্রশ্নের জন্য ফলাফলের অতিরিক্ত সেট পুনরুদ্ধার করতে হয়।
API একটি API প্রতিক্রিয়াতে কতগুলি আইটেম অন্তর্ভুক্ত করা উচিত তা নির্দেশ করতে maxResults
প্যারামিটার ব্যবহার করে। API-এর প্রায় সমস্ত list
পদ্ধতি ( videos.list
, playlists.list
, ইত্যাদি) সেই প্যারামিটারটিকে সমর্থন করে৷
যদি কোনো প্রশ্নের জন্য অতিরিক্ত ফলাফল পাওয়া যায়, তাহলে API প্রতিক্রিয়ায় একটি nextPageToken
প্রপার্টি, একটি prevPageToken
প্রপার্টি বা উভয়ই থাকবে। ফলাফলের একটি অতিরিক্ত পৃষ্ঠা পুনরুদ্ধার করতে pageToken
প্যারামিটার সেট করতে এই বৈশিষ্ট্যগুলির মানগুলি ব্যবহার করা যেতে পারে।
উদাহরণ স্বরূপ, নিম্নলিখিত ক্যোয়ারীটি "স্কেটবোর্ডিং কুকুর" কোয়েরির সাথে মিলে 10টি সর্বাধিক দেখা ভিডিওর জন্য অনুসন্ধান ফলাফল পুনরুদ্ধার করে:
https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.search.list?
part=snippet
&maxResults=10
&order=viewCount
&q=skateboarding+dog
&type=video
এপিআই প্রতিক্রিয়াতে ক্যোয়ারীটির জন্য প্রথম 10টি মিলের পাশাপাশি একটি nextPageToken
প্রপার্টি রয়েছে যা পরবর্তী 10টি ফলাফল পুনরুদ্ধার করতে ব্যবহার করা যেতে পারে:
নীচের ক্যোয়ারী কোয়েরির জন্য পরবর্তী 10টি ফলাফল পুনরুদ্ধার করে:
https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.search.list?
part=snippet
&maxResults=10
&order=viewCount
&pageToken=CAoQAA
&q=skateboarding+dog
&type=video
দ্রষ্টব্য: APIs এক্সপ্লোরারে এই অনুরোধটি সম্পূর্ণ করতে আপনাকে pageToken
প্যারামিটারের মান আপডেট করতে হতে পারে। সঠিক pageToken
প্যারামিটার মান পেতে প্রথম 10টি ফলাফল পুনরুদ্ধার করে এমন প্রশ্নটি চালান।
অন্য কিছু উল্লেখ না করা থাকলে, এই পৃষ্ঠার কন্টেন্ট Creative Commons Attribution 4.0 License-এর অধীনে এবং কোডের নমুনাগুলি Apache 2.0 License-এর অধীনে লাইসেন্স প্রাপ্ত। আরও জানতে, Google Developers সাইট নীতি দেখুন। Java হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2024-11-23 UTC-তে শেষবার আপডেট করা হয়েছে।
[null,null,["2024-11-23 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eThe YouTube Data API (v3) uses the \u003ccode\u003emaxResults\u003c/code\u003e parameter to determine the number of items returned in a query response.\u003c/p\u003e\n"],["\u003cp\u003eAPI \u003ccode\u003elist\u003c/code\u003e methods, such as \u003ccode\u003evideos.list\u003c/code\u003e and \u003ccode\u003eplaylists.list\u003c/code\u003e, support the \u003ccode\u003emaxResults\u003c/code\u003e parameter for pagination.\u003c/p\u003e\n"],["\u003cp\u003eIf more results are available, the API response includes \u003ccode\u003enextPageToken\u003c/code\u003e and/or \u003ccode\u003eprevPageToken\u003c/code\u003e properties.\u003c/p\u003e\n"],["\u003cp\u003eThese token values can be used to set the \u003ccode\u003epageToken\u003c/code\u003e parameter to retrieve additional result pages.\u003c/p\u003e\n"],["\u003cp\u003eThe initial request fetches the first page of results, and subsequent requests use the \u003ccode\u003epageToken\u003c/code\u003e from the previous response to get the next page of results.\u003c/p\u003e\n"]]],["The YouTube Data API (v3) uses `maxResults` to specify the number of items in a response. `list` methods support this, and responses with additional results include `nextPageToken` or `prevPageToken`. These tokens, used with the `pageToken` parameter, retrieve further result sets. For instance, a query can get 10 most viewed videos, and a `nextPageToken` in the response allows fetching the next 10 by adding this value in the `pageToken` parameter.\n"],null,["# Implementation: Pagination\n\nThe following example shows how to retrieve additional sets of results for YouTube Data API (v3) queries.\n\nThe API uses the `maxResults` parameter to indicate how many items should be included in an API response. Almost all of the API's `list` methods ([videos.list](/youtube/v3/docs/videos/list), [playlists.list](/youtube/v3/docs/playlists/list), etc.) support that parameter.\n\nIf additional results are available for a query, then the API response will contain either a `nextPageToken` property, a `prevPageToken` property, or both. Those properties' values can then be used to set the `pageToken` parameter to retrieve an additional page of results.\n\nFor example, the following query retrieves search results for the 10 most viewed videos matching the query \"skateboarding dog\": \n\n```\nhttps://developers.google.com/apis-explorer/#p/youtube/v3/youtube.search.list?\n part=snippet\n &maxResults=10\n &order=viewCount\n &q=skateboarding+dog\n &type=video\n```\n\nThe API response contains the first 10 matches for the query as well as a `nextPageToken` property that can be used to retrieve the next 10 results:\n\nThe query below retrieves the next 10 results for the query: \n\n```\nhttps://developers.google.com/apis-explorer/#p/youtube/v3/youtube.search.list?\n part=snippet\n &maxResults=10\n &order=viewCount\n &pageToken=CAoQAA\n &q=skateboarding+dog\n &type=video\n```\n\n**Note:** You may need to update the value of the `pageToken` parameter to complete this request in the APIs Explorer. Execute the query that retrieves the first 10 results to obtain the correct `pageToken` parameter value."]]