I'm trying to search for the artist's top track within a certain country market, unfortunately, it seems like Spotify doesn't allow that (since my account country is already set and cannot be changed)
https://developer.spotify.com/documentation/web-api/reference/#/operations/get-an-artists-top-tracks
I'm using a param in the request with the country code -> ?country=BRbut the response received shows results accordingly to my country.
I'm aware of the fact that -> "If a valid user access token is specified in the request header, the country associated with the user account will take priority over this parameter"
Is there any way to bypass this?
Related
One of our testers found this issue:
This foursquare venue
https://foursquare.com/v/whole-foods-market/4a38676cf964a520f49e1fe3
When returned as a result of this url query
https://api.foursquare.com/v2/venues/search?ll=32.747837,--17158101&radius=250&intent=checkin [some more parameters including secret key]
Produces a result JSON string which includes the venue, but the array of contact data is completely empty. The foursquare page for the venue lists the twitter contact and URL contact fields, but the JSON looks like this:
{"id":"4a38676cf964a520f49e1fe3","name":"Whole Foods Market","contact":{},"location" [more data]
Other venues returned by the search typically have the contact data. I noticed that this one venue does not have a phone number specified. Could the API be triggering off of that and null'ing out the entire contact list?
UPDATE: Here is the complete URL request, with the exception of the ID and KEY values
https://api.foursquare.com/v2/venues/search?ll=32.747837,-117.158101&radius=250&intent=checkin&limit=50&v=20120502&client_secret=XXX&client_id=YYY&categoryId=4bf58dd8d48988d1f9941735,4bf58dd8d48988d118951735,4d4b7105d754a06374d81259,4d4b7105d754a06376d81259
There's one of two scenarios: (1) the venue has a twitter name associated with it or (2) the chain that the venue belongs to has a twitter name associated with it. In the case of (2), you'll find the twitter name in the page user object associated with the venue. Foursquare looks for the venue twitter name first, then falls back on the chain twitter name when rendering the user-facing venue page.
This page -- https://developer.foursquare.com/docs/responses/venue -- specifies the fields returned by a venue query, and lists whether or not they are always returned or only sometimes returned.
This venue has a facebook URL specified:
https://foursquare.com/v/specialty-produce/4ab5b07df964a520d57520e3
But when I get the venue data from a venue search, it does not include that field (see below) and it is not listed in the document for the Venue endpoint located at
https://developer.foursquare.com/docs/responses/venue
I therefore can't tell if it should be expected in the contact object (which is where the twitter page is) or up one level (which is where the venue URL is located) and whether or not it is in either the compact or complete object some/none/all of the time.
Note that I am sometimes seeing a "facebook" field, such as this venue:
https://foursquare.com/v/somewhere-loud/5179ef7fe4b076127bf04922
which returns the following "contact" dictionary
"contact":{"twitter":"somewhereloud","facebook":"461351130570902"},
Here's an example of a response with no facebook field, even though the venue has one shown on their page on foursquare.
{"venues":[{"id":"4ab5b07df964a520d57520e3","name":"Specialty Produce",
"contact":{"phone":"6192953172","formattedPhone":"(619) 295-3172","twitter":"specialtyprod"},
"location":{"address":"1929 Hancock St, #150","crossStreet":"Noell Street",
How do I determine when and where to find this field for any particular venue?
Facebook URLs aren't always returned in the contact object in a venues response; only the fields currently documented are guaranteed to be returned.
On Foursquare's own venue pages, if the venue has a page associated with it, the Facebook URL may be pulled from the user object within the page object. For the example you gave, you can see that the Facebook ID (which translates to the URL) comes from response.venue.page.user.contact.facebook: https://developer.foursquare.com/docs/explore#req=venues/4ab5b07df964a520d57520e3
I'm trying to filter a single SoundCloud user's tracks with a query (or even a tags/genre filter). I can get a user's tracks, but as soon as I add a query parameter, it returns all sound cloud users tracks.
This doesn't work:
SC.get('/users/00001/tracks', {q: 'Black Night'}, function(tracks) {
// returns tracks from all soundcloud users which contain 'Black Night'
// rather than the single user
});
Nor does this:
SC.get('/tracks', {user_id: '00001', q: 'Black Night'}, function(tracks) {
// returns tracks from all soundcloud users which contain 'Black Night'
// rather than the single user
});
You would first get all the songs by that specific user, for that you can use the code you used.
After that, you need to loop through all the songs you just retrieved and assign tracks[i].genre to a variable (let's say var track_genre)
Next, check if track_genre === myGenre (a parameter you give the function, which the user can choose)
If it's the case, go ahead and oEmbed the widget
I guess the main takeaway would be that you CAN access the genre of the songs you retrieved with 'SC.get' and filter on that, but you CANNOT SC.get specific genres FROM a specific user.
Anyway, that's how I just gotten around this particular problem; I'm sure there'd be better solutions, but this one works so... ;-)
soundcloud api does not work that way.
you can search All tracks by term, genre, bpm, date etc
or you can get user resources (tracks, favorites, groups, followers etc)
the best way to search inside tracks or any other user resource, is to get all results, and do the search inside the results.
Here under Subresources you can find /users/{id}/tracks - list of tracks of the user
Querying user data on Facebook Graph via the Javascript API will not return all fields.
For example, the following query:
/search?q=David Blades&type=user&fields=location,work,id,name,picture,link
Returns everything except work and location.
Does anybody know the reason why?
Because these fields are not publicly available, please refer to the User object:
Name Permission
id No access_token required
name No access_token required
...
location user_location or friends_location
Im wondering if there is anyway to interogate facebook data on user interests. i.e. Retrieve the following data sets:
What are the most like interests/Pages on facebook?
Retreive the current users facebook interest and also their friends interests?
Really want to know if we can get facebook global interest/like data and than also if the user connects their facebook account to the site than we can also retrieve their interest data.
Thanks in advance
So you want to implement something like http://www.socialbakers.com/ ?
To get 1) you'd have to periodically poll the API for the public fan count of a known set of page IDs to see the current fan counts ( i think this is what socialbakers do)
To get 2, get the user_likes and friend_likes extended permissions from your users and access the /likes connection of the users whose likes you want to read
Yes you can retrieve user interests from facebook. You just need to include the user_interests permission required in your jsp page.
https://developers.facebook.com/tools/explorer/
If you are using spring social you can generate your own url for /me/interests:
URIBuilder uriBuilder1 = URIBuilder.fromUri(facebook.GRAPH_API_URL + "me" +"/interests");
String s = facebook.restOperations().getForObject(uriBuilder1.build(), String.class);