I want to get a list of the last builds of my TFS.
The API in general works well - but I don't understand the working of the "$top"-Parameter.
If I use a simple API call without the top-Parameter:
https://mytfs/project/_apis/build/builds?buildQueryOrder=finishTimeAscending
I get the max amount of 1000 results, correctly ordered with the newest on top/first.
If I add the $top-Parameter:
https://mytfs/project/_apis/build/builds?$top=10&buildQueryOrder=finishTimeAscending
I get 10 results - but not the first 10 from the larger list - but 10 random results (but always the same 10 - thus not really random). But this are not the newest 10 or the oldest 10 - just 10 out of 1000.
Am I understanding the $top-Parameter wrong? Or is this a bug in the TFS API?
Update
Sorry for the misunderstanding. This is by design just as the description. It will only return the maximum number of builds not with a sequence order of return results.
In other words, if you use $top Parameter, it will fetch 10 results of all build results and then order the returned the 10 results. It will not first order all build results and then fetch the top 10 of the ordered build results. Maybe that's where the confusion is.
For what you are looking for, it's not available with existing parameter. You could only get the max amount of 1000 results with correctly ordered first. Finally fetch 10 of them.
The $top parameter not work as the literal meaning. It will just return the maximum number of builds.
$top integer int32 The maximum number of builds to return.
You could refer the official doc here: Builds - List
Related
I have an array of UIDs (String) and I want to perform a query using Firestore where I get all the documents in which the field "uid" is equal to any of the ones in the array provided.
Till now I tried doing:
ref.whereField("uid", in: uidArray)
But this doesn't work and gives me an error because the maximum number of elements in the array must be 10 and it surely surpasses that limit.
My question is: how can I achieve the same result with a workaround using Firestore?
Whenever I try to implement a query using this DB it seems it's built for making developers' lives harder.
Yes, according to the docs, the maximum number of elements in the array is 10. To be able to get over this limitation, you should perform successive calls. For example, if you need to check a field against 35 values, then you should perform 4 queries. Three queries with the 10 elements and the fourth with 5 elements. Lastly, you should combine the result on the client.
When calling https://www.googleapis.com/youtube/v3/search?, I can get the first 50 results and subsequent 50 using the nextPageToken; however, when I try to get results past 100, the api returns a 200, gives me total request figure and returns a list - but the list is empty - "items": [].
I have been using these calls in a query for more than 18 months. Has there been a recent change to the API that I've missed in the documentation? Last change I see today doesn't address this issue and the next one from the API reference is from Nov 2017.
I ran into this exact issue when trying to get all the live broadcasts on YouTube Gaming. Everything I read resulted in some complicated explanation of how Google's search engine returns the count and why they limit some queries to 500 or so, but I have absolutely seen some companies tracking the data beyond the first 100. Nothing answered the issue you and I both ran into, but if I find something I'll report back.
It seems the "500 results" limit has been silently reduced to 100-150, by design, or by bug.
Either use date ranges, or sub-divide your queries (a and b1, a and b2, a and b3, ....) to keep each result set below 50
Good day. I'm trying to get the top videos for gaming within the specified publish dates ordered by view count. I'm having a problem with the number of items that it is returning in the JSON response because it's less than 50 items even though I have set the maxResults parameter to 50 and the JSON response returns pageInfo.resultsPerPage equal to 50. The pageInfo.totalResults also returns a lot more than 50 so it should be displaying 50 items in the result. As an example, I'm using the followng URL
https://www.googleapis.com/youtube/v3/search?key={API_Key}&part=snippet&maxResults=50&order=viewCount&publishedAfter=2017-02-01T00%3A00%3A00Z&publishedBefore=2017-02-01T00%3A01%3A59Z&type=video&videoCategoryId=20
The returned result here the last time I ran this query has 20 items even though there are 161,307 total results. I would like to ask a solution that will make sure that I will always get the number of items equal to the maxResults if possible. Hope someone can help me on this. Thank you very much.
EDIT: I know how to use the page token, but I'm not aiming for getting the items that I need for more than one request (as the Data API have limited credits per day). The issue that I'm trying to resolve is to make sure that I always get 50 items everytime I invoke the request.
Although there are 160k+ total results, your publishedAfter/publishedBefore filters cut the number returned down to the videos published in that time range, which is 20.
Well, I got 50 results with the URL request that you provided. Just make sure that you place right value on the parameter that you use, especially the value in publishedAfter. You can also use the parameter pageToken to get the next page or next 50 results.
For more information, check this SO question on how to use pageToken
[Problem 1]
I am using https://developers.google.com/youtube/v3/docs/subscriptions/list for a large channel (1 million subscribers) but after 100 successful pages of results (50 subscribers per page), the API always returns 0 subscribers.
Is there a hard limit of 100 pages or 5,000 subscribers that can be returned?
[Problem 2]
Of the 5,000 Subscribers returned, only 3,577 are unique. The API seems to be returning duplicates in some cases which I know is a long standing issue with getting channel subscribers. Hoping to learn if this will be fixed?
I ran into the second problem today and it seems like the duplicates happens because the default order of the API list is SUBSCRIPTION_ORDER_RELEVANCE
Acceptable values are:
alphabetical – Sort alphabetically.
relevance – Sort by relevance.
unread – Sort by order of activity.
So setting order to be alphabetical solves the problem entirely.
Through a script I can collect a sequence of videos that search list returns. The maxresults variable was set to 50. The total number items are big in number but the number of next page tokens are not enough to retrieve all the desired results. Is there any way to take all the returned items or it is YouTube restricted?
Thank you.
No, retrieving the results of a search is limited in size.
The total results that you are allowed to retrieve seems to have been reduced to 500 (in the past it was limited to 1000). The api does not allow you to retrieve more from a query. To try to get more, try using a number of queries with different parameters, like: publishedAfter, publishedBefore, order, type, videoCategoryId, or vary the query tags and keep track of getting different video id's returned.
See for a reference:
https://code.google.com/p/gdata-issues/issues/detail?id=4282
BTW. "totalResults" is an estimation and its value can change on the next page call.
See: YouTube API v3 totalResults field is returning 1 000 000 when it shoudn't