spotify API query not producing Album metadata - api

I'm trying to build a app that gets info from the Spotify API but since I don't have the Spotify ids I want to grab the ids using search queries.
I wanted to just try it so I tested it with an album called yellow and a band called SCANDAL. However when I query, say, https://api.spotify.com/v1/search?q=album:yellow+artist:scandal&type=album it comes up with nothing. However when I Google the band, I got an artist id: 7hTZwqQILVH4bAbN67CeEz from the URL.
using the get albums query(https://api.spotify.com/v1/artists/7hTZwqQILVH4bAbN67CeEz/albums?album_type=album&limit=5) it shows that the album exists but the original query didn't find it. Am I doing something wrong or does it only work with more popular artists (I tried other albums and it was fine)?

There doesn't seem to be anything wrong with your query. I think you are hitting a bug.
Bug reports for Spotify Web API can be found in Github issues
According to this bug:
https://github.com/spotify/web-api/issues/194
setting no market parameter will make it default to US. Your query seems to confirm this bug. Since SCANDAL Yellow is not available in the US, you will not see it in the results. If you add market=SG for instance, it will show up.

Related

How to find only original tracks on soundcloud

I am using soundcloud API for a project but the problem is I get remix of the original songs or cover version, its okay if I get remix and cover version but is there any mechanism that the original one comes as first song in the search result ? I tried searching on Google and read the API documentation but found nothing in this context.
The track object in soundcloud's API actually has the track_type property which has possible values of 'original' and 'remix' among other things. Sadly like most valueable metadata the track object has, content providers neglect to fill the field. So unless content providers start putting more effort into filling in the metadata fields the only option you have is giving songs priority based on words in the title or tags.

Instagram: sort photos with a specific tag with most likes

I'm running a contest on the web where the image with the most likes wins. It's tiresom having to go through 900 images manually so what I want to do is, sort all images with the tag lets say #computer after the amount of likes, with the most liked pics on top. I have searched the net like crazy for some program or site that does this (ExtraGram, gramhoot, statigram, webstagram) but none offer to sort by amount of likes and it drives me INSANE! It's a really relevant request.
I've tried istafeed.js but it doesn't include all images, actually it leaves out the ones with the moest likes which defies the purpose.
There's nothing I know of in the Instagram API that sends back media sorted by likes in advance. I don't think there's a tool to do this either, but writing one is relatively simple IMO and I've done it before for a contest specifically.
The simplest thing to do is to do the following:
Use the Instagram API (via a library or pure REST) to query by tag. For instance, if you only care about the most recently tagged media or you want to process by date, you can use the [/tag/tag-name/media/recent][1] enpoint.
Page through each result page by processing the next_max_id/next_max_tag_id.
Collect the results locally into a database. You will receive the "like" count for each media item. You will have to update the data if you want to track the likes over time.
Sort the results using your database or if it's a small result set, you could skip #3 and just sort in memory.
If you need to refresh the results, you need to subscribe to the Tag via the API. You can give Instagram a URL to then push updates, and then you'll have to retrieve 1 or media items and update them in your database accordingly.
You will of course need to register your application with Instagram to get an API key if you want to do this. Then you can either send them your client_id or use OAuth.
The best way to achieve this is to pull the photos in and then sort them programmatically based on the likes numeric value. I've designed a plugin that does this automatically for you for anyone interested.
Instagram Journal

Querying Foursquaure Venue photo API without identifying group. Bug or as designed?

I'm trying to get one good photo result on the Foursquare API which are representative of a venue.
Currently I'm using:
https://api.foursquare.com/v2/venues/VENUE_ID/photos?group=venue&limit=1
This works, but it appears that the photo filtered is always the most recently added photo for that venue, which is not necessarily always the best. There also doesn't seem to be anyway to any sort differently (by rating etc.). I would prefer that the photo that appears be always the first photo result on the foursquare website for the venue, whatever that may be.
I was playing around with the suffix, and I found that if instead of
photos?group=venue&limit=1
I just put
photos?&limit=1
I would get the results I am looking for (the first photo that appears on the website for that venue). However, on the documentation it says that having a group value is required. Obviously, I don't want to set behavior based on a bug, but it works.
So, is it a bug? Or is it just a problem with the documentation that says group is required. Any help would be appreciated.
Thanks!
That's probably a bug you're encountering, but to get the first photo on the venue page, you can query the venues detail endpoint and then use the photo object in the venue result: https://developer.foursquare.com/docs/explore#req=venues/40a55d80f964a52020f31ee3

YouTube Playlist API no longer functioning?

According to YouTube's docs:
https://developers.google.com/youtube/2.0/developers_guide_protocol_playlists
I can go to the following URL to retrieve a list of videos in a youtube playlist:
https://gdata.youtube.com/feeds/api/playlists/8BCDD04DE8F771B2?v=2
Works well right? Well no... I've been unable to find a single playlist that actually works besides the one supplied by youtube. I have a playlist here: http://www.youtube.com/playlist?list=PLABD2A8CE079F70FA. It would be logical that if I simply take the ID of the playlist and plug it into the gdata URL, it should return valid data, correct? Nope... doesn't work:
https://gdata.youtube.com/feeds/api/playlists/PLABD2A8CE079F70FA
It appears that the API doesn't work with any playlist that starts with their new "PLA" format. What do I need to do, to get the youtube API working with the new playlist system?
Well I figured it out. The playlist API is designed with the OLD Youtube Playlist IDs in mind, the ones without the "PL" at the start. So if you want to retrieve information about the videos in a playlist, you need to drop the PL from the Playlist ID and then it will work fine...
Example:
https://gdata.youtube.com/feeds/api/playlists/ABD2A8CE079F70FA
VS:
https://gdata.youtube.com/feeds/api/playlists/PLABD2A8CE079F70FA
You can add query parameters to the url. With the max-results query you can fetch a maximum of 50 results. If you want more than 50 requests, you need to call this multiple times with start-index query.
https://gdata.youtube.com/feeds/api/playlists/PLABD2A8CE079F70FA?v=2&max-results=50 will give maximum of 50 results. Fetch the next 50 results by adding the query start-index=51&max-results=50. Currently this is the only way you can achieve it.
Check this your playlist,It works fine
http://gdata.youtube.com/feeds/api/users/Jaxelrod/playlists/DC725B3F130398B2?v=2

Graph API: How to get albums in right order?

I'm developing application using Graph API. It reads page's photo albums, but they are returned ordered by time they were uploaded even though their order was changed on Facebook by page admin (drag & drop style).
Is there any possibility to get albums ordered as admin intended?
Neither http://developers.facebook.com/docs/reference/api/album/ nor http://developers.facebook.com/docs/reference/fql/album/ expose a sort order field. I'd suggest filing a bug at http://developers.facebook.com/bugs and hope facebook thinks it's cool enough to include in a future release.