Retrieve all of a user's playlist from SoundCloud limited to 50? - soundcloud

I'm trying to retrieve all the playlists from my account via
http://api.soundcloud.com/users/145295911/playlists?client_id=xxxxxx, as the API reference shows.
However, I can only retrieve recent 50 playlists instead of all of my playlists. I've been looking for this but it seems like no one has had this issue before. Is there a way to get all of them?

Check out the section of their API on pagination.
Most results from our API are returned as a collection. The number of items in the collection returned is limited to 50 by default with a maximum value of 200. Most endpoints support a linked_partitioning parameter that will allow you to page through collections. When this parameter is passed, the response will contain a next_href property if there are additional results. To fetch the next page of results, simply follow that URI. If the response does not contain a next_href property, you have reached the end of the results.

Related

Google Places API filter by "user_ratings_total" number or between range

I'm trying to figure out a way to filter Places API results by number of user ratings despite the rating score, I've done something like this but it doesn't makes a difference : https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=24.7588310%2C46.7330426&radius=10500&type=restaurant&user_ratings_total=15000&key=GOOGLE_API_KEY.
My actual goal is to have a result similar to (Example: Show list of restaurants with number or total ratings more than 1000 users and rating score with 4.5)
Your assistance is much appreciated.
I don't think the user_ratings_total is used liked that. It is only a value set for place details request and not a parameter itself. The parameter that usually uses it is the fields parameter for place detail request.
The docs says:
"Place Search requests and Place Details requests do not return the same fields. Place Search requests return a subset of the fields that are returned by Place Details requests."
This means that the reviews and ratings that are being returned on your sample request are just a common result from nearby search. In this case "a subset of the fields".
"To return one or more of these data fields for a place, make a Place Details request, pass a place ID, and specify which fields to return."
ref: Place Data Fields docs
A Place Details request looks like this: https://maps.googleapis.com/maps/api/place/details/output?parameters
And fields parameter can be added in this format: fields=user_ratings_total
In summary, user_ratings_total is not used to filter Nearby Search result, but it is used to get more total ratings of a user in a certain Place/POI using Place Details request.
I tried looking through the docs and I can't seem to find this feature on the Places API. So what you can do for now if your really want this feature, is to file a Feature Request on Google Issue Tracker and let it be reviewed by Google engineers if it is possible to be implemented on the API.

Determine the proper REST API method

I have the following functionalities in my API:
Getting a user by their name
Getting a user by their ID
Getting a user, or if it doesn't exist create one
Getting multiple users by their ID
Currently I'm handling the two first functionalities with a GET request, and the third with a POST request. I could use a GET request for getting multiple users, but sending potentially hundreds of IDs through a query parameter seems like the wrong approach, as I would get a very long URL. I could also use a POST request to send the long list of IDs through its body, but I doubt a POST request is meant for this purpose.
What method would be appropriate to use for the last one?
I see 2 possible ways here:
Get all users and do your filtering post response.
Get a range of IDs, which resumes to only 2 parameters, the lower and the upper limits of the interval. (If this satisfy your needs)
Behaving the way you described and avoiding long URLs in the same time will not work together.

Get Facebook page like count for OpenGraph v2.10

I can't get Facebook to return the page like count, the response provided does not match what the API states. According to the docs, the following URL:
https://graph.facebook.com/v2.10/<page-id>/likes?access_token=<access-token>&summary=true
should return a JSON response with a summary key that provides the like count in the corresponding hash. The problem is the response never contains the summary key, but it does contain the data and pager keys as specified in the docs.
I'm certain my access token is valid and my page ID are correct.
I've also tried to get the page_fans metric from the page insights via the following URL, but it simply returns an empty data object.
https://graph.facebook.com/v2.10/<page-id>/insights/page_fans?access_token=<access-token>
Is there another way to go about retrieving the like count for a page or any particular reason that the requests would succeed, but be missing the relevant data?
Facebook Doc Links:
https://developers.facebook.com/docs/graph-api/reference/v2.10/object/likes
https://developers.facebook.com/docs/graph-api/reference/v2.8/insights
UPDATE
I was able to retrieve the count by using this Graph API call:
https://graph.facebook.com/v2.10/<page-id>?access_token=<access-token>&fields=engagement
As New Hand pointed out, you can get the key directly, without going through the engagement field using the following:
https://graph.facebook.com/v2.10/<page-id>?access_token=<access-token>&fields=fan_count
Do you mean to get the fan_count?
Please try this:
https://graph.facebook.com/v2.10/<page-id>?access_token=<access-token>&fields=fan_count

REST collections: pagination enabled by default?

I am trying to figure out what is the common way to respond on GET operation to retrieve multiple resources. For example, if user calls: /books or /books?name=*foo* etc what should good REST api return?
[A] list of all resources in collection. Only if user specifies a range (using start and limit or in any other way), then only a page of results is returned.
[B] always return a first page of resources, even when nothing is specified. Then user may continue with pagination, using the parameters (or any other way).
[C] a document indicating that paging is be involved, with total number of resources in the collection, but without any returned resource; with appropriate status code set (like 300 if I remember correctly at this moment). This response indicates to the user that he can start fetching its data using pagination parameters.
I like C approach, but could not find APIs that are having this.
This depends on either the pagination parameters are mandatory or not. For most APIs it's mandatory simply because /books could return millions of entries.
How about [D]: a redirect.
If the client accesses /books or /books?name=foobar redirect it to /books?page=1&size=15 or /books?name=foobar&page=1&size=15 and return results according to those default parameters.
You could also include pagination links into your response (as per HATEOAS) with a rel attribute that specifies that a link is for the next page, previous, first or last page, so the client can also navigate back and forth between the result pages.

Pagination in the event search API

I am performing a rest call to facebooks search API using type=event
e.x.
search?fields=id,name,picture,owner,description,start_time,end_time,location,venue,updated_time,ticket_uri&q=concert&type=event
I have looked through the documentation and still have a few questions about specific pagination behavior of the event search API.
If I used a broad search term like "ma" and keep querying the pagination ['next'] URL would I cycle through all facebook events starting with "ma"? Does the pagination array give any indication when there are no more results to return?.
Do these searches include past events? If so is it possible to eliminate past events using the "since" parameter?
What is the maximum for the limit parameter?
Update:
As far as I can tell the number of pages you can get from a facebook search is limited to 500. This includes pages that can be accessed via pagination. In other words a query with limit >=500 will not return a pagination url, likewise a query with limit 250 will only return one pages worth of pagination.
You will "next page" until the count of results comes less then the limit
I'm not sure if that is possible using a simple Graph Request. Maybe using FQL
I don't know exactly. But i used a 2000 limit one day. And it worked.
Other doubts you can get answers testing your resquests with this tool
https://developers.facebook.com/tools/explorer/
I am also doing the same thing like you. I am collecting public post using graph search api.
When there are no results available or you reach max limit pagination section will not be there in response. So you can always check for paging is there in json response or not something like this.
NextResult = DeserJsonFBResponce.paging != null ? DeserJsonFBResponce.paging.next : string.Empty;
I am not so sure about this with events but for public post i am able to eliminate post using science and until parameters.
Maximum for the limit parameter is 2000 per get request.