Am trying to get follower_by users for specific user using yammer rest API.
It returns only 50 items and but actually I have 115 following.
Api url : /users/[userid]/followed_by.json
Could be that you have a limit parameter set to 50
Related
I am using the marketing API
I have an issue with the pagination, it seems like it ignores the start and count.
I am using the start and count query parameters and no matter what number I put in the count, I get a response with all the results
I followed this document for pagination:
https://learn.microsoft.com/en-us/linkedin/shared/api-guide/concepts/pagination
I use this endpoint:
https://api.linkedin.com/v2/adAnalyticsV2
my parameters include:
start=0&count=10&q=statistics&timeGranularity=MONTHLY ....
in the response, I received 821 elements without any pagination. instead of 10 per page.
if I use the logic in the docs the values for start and count will not affect the results or the query
what am I doing wrong?
I don't want to use it without pagination and find out later that I missed records.
Thanks,
Roiy
I have used pagination to retrieve the posts of the organization, and its working for me
my api call is
api_url = "https://api.linkedin.com/v2/shares?q=owners&owners=urn%3Ali%3Aorganization%3A123456&sharesPerOwner=1000&count=100&start=0"
one thing importantly i noticed is this does not requires restli2.0 version(dont pass this in header)
https://api.github.com/search/issues?q=stress+test+label:bug+language:python+state:closed
the above query is suppose to return 76 results, and when I try to run it, it only returns 30. I guess GitHub return results in portions when it is over 30. Any idea how I can get the rest of the results?
You need to use page parameter, e.g. for next 30 page = 2
https://api.github.com/search/issues?q=stress+test+label:bug+language:python+state:closed&page=2
You can also use per_page parameter to change the default size of 30. It supports max size of 100. Like this:
https://api.github.com/search/issues?q=stress+test+label:bug+language:python+state:closed&per_page=100
More detail can be found here
The Problem: Github api response doesn't contain all the relevant data.
Solution: The api from server is limiting the amount of items the user gets and splitting it into pages (pagination). You should explicitly Specify in your request how many items you'd like to receive from server pagination engine ,using formula for Github pagination api
?page=1&per_page=<numberOfItemsYouSpecify>"
For example: I'd like to get all my collaborators info in my private repo. I'm performing curl request to Github contains: username, authentication token , Organization and repository name and api call with pagination magic.
curl -u johnDoe:abc123$%^ https://api.github.com/repos/MyOrganizationName/MyAwesomeRepo/collaborators?page=1&per_page=1000"
Explanation:
What is Pagination: Pagination is the process of splitting the contents or a section of a website into discrete pages. Users tend to get lost when there's bunch of data and with pagination splitting they can concentrate on a particular amount of content. Hierarchy and paginated structure improve the readability score of the content. Loading pages is due to the less content on each item and each page has a separate URL which is easy to refer.
In this use case Github api splits the result into 30 items per resonse, depends on the request
Github reference:
Different API calls respond with different defaults. For example, a
call to List public repositories provides paginated items in sets of
30, whereas a call to the GitHub Search API provides items in sets of
100
I am trying to use Instagram API to create a gallery with all user's instagram pictures.
But I have just about 33 pictures in the gallery.
Can you help me please? How can I fix this?
$response = file_get_contents('https://api.instagram.com/v1/users/' . $target . '/media/recent?access_token=' . $_SESSION['instagram_token'] . '&count=-1');
According to documentation you are using an endpoint which will return all recent media from the user. Thus it does not promise to return all images. Even though you specify a count, there is a maximum number of images returned.
However, you can use pagination; see the following question/answer for information:
Instagram API: How to get all user media?
I suppose you can read 20 per request, then find the lowest id of the result and use this as the max id of the next request.
Request 1 (no max_id)
Id 100
Id 99
..
Id 81
Request 2 (max_id=81)
Id 80
..
Id 61
Request 3 (max_id=61)
Id 60
..
Id 41
Then keep requesting until you do not get any more media returned
Each API call will return maximum of 20 photos, you have to use the pagination.url in the API response to make another API call to get next 20 photos and so on.
https://api.instagram.com/v1/users/3/media/recent/?access_token=ACCESS-TOKEN
The Instagram API imposes a silent, undocumented limit on how many results it returns. Even if you pass in a count higher than 33, it will only return, at most, 33 results.
I have written a hack in Javascript which eliminates this limit at the cost of making more API calls. At the moment, it only works if you query by user, but I can implement it so it works for queries by tag too, depending on my available time and demand.
Feel free to contribute by submitting pull requests! (You may want to translate what I did to PHP code so you can securely use the access token)
I'm trying to get all users at same place as me (venues with a lot of people), but the endpoint https://api.foursquare.com/v2/venues/VENUE_ID/herenow returns more than 30 users in count property and only 30 people in items list.
Is there any way to get all check-ins and users at same place as me?
you can use the parameter limit to retrieve up to 500 users per request. use the parameter offset to page through more results. see here for more information.
The foursquare venue search api documentation states that the limit parameter can go up to 50, but if I set it to 50, I only get 20 results. I know I'm using the api correctly because if I set the limit to 5, I get 5 results. Is there something special I need to do to get 50 results?
For reference, here is the url I am using:
https://api.foursquare.com/v2/venues/search?ll=' + latlong + '&client_id=myclientid&client_secret=myclientsecret&v=20120214&limit=50
Thanks
I found that was cutting out all the venues past 20 in another part of my code before I got around to seeing the results. So it was entirely user error. Woops!