-1

I am making a bulk call with 30 posts and daily data of all. Is there any limits to the number of rows that will be returned by the API? I am having problem getting the results.

Can anyone please help.

  • What is the problem exactly that you are facing? – Juru May 26 '15 at 14:04
  • I am making a batch call for 30 videos. some videos are old like of 2013 and some are of 2015. So I am making a batch call with start date as 1/1/2013 and end date as 26/5/2015.Also I have added day in dimensions as i need to get daily views. I am trying to get data for deviceType and OperatingSystem for video. So one post can give around 10 rows per day. Assuming 2 year range it will be 365*2*10*30 = 219000. Will i get so many rows in one API call? – Prateek Agrawal May 26 '15 at 14:14
  • But I am not getting rows for all as there are no records saved for some posts in my database. – Prateek Agrawal May 26 '15 at 14:14
  • So I wanted to know is there any limit on number of rows returned? So that I can make a date batch and then call.Instead of calling for whole range at once. – Prateek Agrawal May 26 '15 at 14:14
  • @Juru can you please help ? – Prateek Agrawal May 26 '15 at 14:15

1 Answers1

0

YouTube doesn't return any rows ... it's not relational data. That may sound like a pedantic thing to point out, but it's crucial for this next point; the API will return 50 videos at a time, along with tokens to get more results based on the same query, up to a total of 500 ... because the data isn't relational, you can't just "select all rows" that match a certain criteria. Rather, it is probabilistically determining relevance to your search parameters, and after about 500 results the algorithms don't have enough certainty to make additional results relevant.

So in your case, where you can change the date as needed (to allow the algorithms to be more specific), you'll want to do a series of calls; perhaps one at a time (since you have to paginate anyway to get more than 50 results, it's probably not that much more expensive in terms of network bandwidth).

jlmcdonald
  • 13,408
  • 2
  • 54
  • 64
  • ], "rows": [ [ "DESKTOP", "MACINTOSH", "-u40JUTCyhA", "2013-10-04", 0, 0 ], [ "MOBILE", "ANDROID", "-u40JUTCyhA", "2013-09-21", 0, 0 ], [ "MOBILE", "SYMBIAN", "-u40JUTCyhA", "2013-12-29", 0, 0 ], [ "MOBILE", "ANDROID", "-u40JUTCyhA", "2013-08-18", 0, 0 ], – Prateek Agrawal May 27 '15 at 04:37
  • i get results in this format so calling this [ "DESKTOP", "MACINTOSH", "-u40JUTCyhA", "2013-10-04", 0, 0 ] as one row , how many such rows are possible are there any limits? – Prateek Agrawal May 27 '15 at 04:38
  • What URL are you calling? That does not look like a YouTube API response object. – jlmcdonald May 27 '15 at 05:30
  • GET https:// www. googleapis.com/youtube/analytics/v1/reports?ids=channel%3D%3DMINE&start-date=2010-05-12&end-date=2015-05-20&metrics=views%2CestimatedMinutesWatched&dimensions=deviceType%2CoperatingSystem%2Cvideo%2Cday&filters=video%3D%3Dwjn2Jb3Cafk%2C-u40JUTCyhA&key={YOUR_API_KEY} – Prateek Agrawal May 27 '15 at 05:35
  • I am directly using Google API explorer for this. In that i get response in this format. and around 3600 rows of this kind is returned. – Prateek Agrawal May 27 '15 at 05:43
  • My mistake. I thought you were making requests to the Data API, but now I see it's for analytics. I don't believe that it's documented anywhere the exact limit that can be returned; however, you can paginate results by using the max-results parameter. When you include it, then subsequent responses pass in the 'start-index' parameter (set to one more than the previous set ...) to get the next set of rows. Additionally, you can pass in the video IDs as a comma delimited list in the filters parameter to batch those; you'll still end up needing to do many calls for all the data you want, though. – jlmcdonald May 27 '15 at 07:57