Linkedin REST API - How to return more job bookmarks / records each call - api

I'm trying to get all my job bookmarks (30+) via Linkedin Rest API but it seems that every call only returns the same exact & only 10 records max.
GET https://api.linkedin.com/v1/people/~/job-bookmarks
then I found the end https://developer.linkedin.com/docs/rest-api
It seems that I can pass the parameter - count: The maximum number of items you want included in the result set. So I thought maybe I can just add that at the end of the GET url...
New query GET https://api.linkedin.com/v1/people/~/job-bookmarks&count=30
then I got an error - 400 Bad Request
Does someone know how to solve this problem? Many thanks!

You need to start the query string with a '?' instead of '&'.
https://api.linkedin.com/v1/people/~/job-bookmarks?count=30
You use '&' to separate query parameters. For example if you wanted to page through all the job book marks you could use the 'start' parameter to do offset paging. So the path to get the next page if you have more than 30 bookmarks would look like this.
https://api.linkedin.com/v1/people/~/job-bookmarks?count=30&start=31

Related

Unpredictable soundcloud api tracklist

I need to get whole user's tracklist by SC api.
Before I use the next link format:
https://api.soundcloud.com/users/{user_id}/tracks/?page_size=200&linked_partitioning=1&client_id={app_id}
But it has stopped to work correct recently.
Changes:
limit has been decreased by SC from 200 tracks to 50;
returned tracks have become random (eg user has 300 tracks, but request above returns 54 tracks and link to the next page of tracks where fields "offset=50&limit=50" are appearing;
when I change field "page_size" from 200 to 50, SC returns only 18 tracks).
Also I've tried to use fields "offset" and "limit" instead of "page_size" but it has worked incorrect, too.
How I can get whole user's tracklist?
You need to parse the response and read next_href then change the url to the next_href value.
It's better to do this as a loop until there is no more next_href
Some recent updates on pagination from the API can be found below. You need to rely on the cursor rather than offset
https://developers.soundcloud.com/blog/pagination-updates-on-our-api

How to get maximum number of tweets on an user

i have this code
("https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=".$twitteruser.'&count=500'
But it is giving me only 200 records , I found in twitter document that it will give 3200 tweets.Is i am doing wrong what should i do to get that much tweet.
Since there is no page system in twitter 's API, to go throught timelines, you must use the "max_id" parameter.
Here is an helpful link that explains how to work with timelines with nice illustrations: https://dev.twitter.com/rest/public/timelines.
Edit: here is how you do it.
"To use max_id correctly, an application’s first request to a timeline endpoint should only specify a count."
Make your request "https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=".$twitteruser.'&count=500 (you can put 200).
Then when you get all your data, " keep track of the lowest ID received" and use it as parameter (the same way you do for the count) for your next request. it will give you the 200 next posts with a lower id than the one you specified. Do it again until you reach the end.

YouTube API Search v3 - Start index?

I'm using the YouTube Search API to grab 5 videos per time under a specific keyword. But I've been trying and trying, but couldent find the parameter for the start index. Does anyone know how to add it, so it gets the next 5 videos etc..?
Current URL I have:
https://www.googleapis.com/youtube/v3/search?part=snippet&q=wiz+khalifa&type=video&key=AIzaSyB9UW36sMDA9rja_J0ynSYVcNY4G25
In the results of your first query, you should get back a nextPageToken field.
When you make the request for the next page, you must send this value as the pageToken.
So you need to add pageToken=XXXXX to your query, where XXXXX is the value you received in nextPageToken.
Hope this helps

Is it correct that the Instagram Location/Search endpoint does NOT support pagination?

I have read several postings about the fact that the Instagram API returns only 20 results at a time. In many cases, people have suggested that all you need to do is to use the next URL which is returned in the pagination information. I would be fine with that, but the JSON returned by
https://api.instagram.com/v1/locations/search?
does not appear to have any pagination information. I have seen a posting that says that /media/search does not support pagination. I just wanted to confirm that the same is true for /locations/search. Can anyone confirm?
And if this is correct, does anyone have any thoughts about how you can get a list of all Instagram events in a specific area, rather than just the first 20 or so?
/media/search end point does not have pagination, but you can get next set of 20 pics by using url param max_timestamp, get the created_time of the last photo in api response and apply it as max_timestamp for next url call, it will return the next 20. Thats how I implemented here: http://www.gramfeed.com/instagram/map
for locations/search end point, timestamp does not apply, you can change distance url param and get more results: http://www.gramfeed.com/instagram/places

Google custom search REST number of results (num field)

I'm trying to figure out how to force google custom search to give me back 20 results per page.
I've tried to send this REST request configuring my new Custom Search Engine to:
Standard edition: Free, ads are required on results pages.
https://www.googleapis.com/customsearch/v1?key=AIzaSyCgGuZie_Xo-hOECNXOTKp5Yk7deryqro8&cx=015864032944730029962:5ipe0q27hgy&q=test&alt=json&num=20
IT NOT WORKS!
but
https://www.googleapis.com/customsearch/v1?key=AIzaSyCgGuZie_Xo-hOECNXOTKp5Yk7deryqro8&cx=015864032944730029962:5ipe0q27hgy&q=test&alt=json&num=10
IT WORKS!
But reading documentation at
https://developers.google.com/custom-search/docs/xml_results#numsp
it says that:
Optional. The num parameter identifies the number of search results to return.
The default num value is 10, and the maximum value is 20. If you request more than 20 results, only 20 results will be returned.
Note: If the total number of search results is less than the requested number of results, all available search results will be returned.
Someone has experienced this problem?
PS: I've tried also to send that REST request configuring my new Custom Search Engine to:
Site Search: Starts at $100 per year, ads are optional on results pages.
But nothing has changed no way to obtain 20 results in a request/page
This documentation url has descriptions of each parameter. It also says num is restricted to integers between 1 and 10, inclusive.
https://developers.google.com/custom-search/v1/using_rest#query-params