How to get a completely random track on Spotify using APIs or other methods - spotify

I'm looking for a way to get a completely random track on Spotify using APIs or any other method. I want to be able to retrieve a random song from the platform without any biases or filters. Is there a way to accomplish this using Spotify's API or some other method? Any help would be appreciated.
Im looking for an algorithm to use I tried search based but it always gives popular songs

Related

Implementing geocoding of cities with my own DB or Google Maps API (or other solution)?

I would like to know what people recommend for geocoding city inputs from users. I am trying to get the Lat/Long of a city a user inputs. One option is to utilize an API with such a service, i.e. Google Maps. Another I was considering was creating my own DB with an online dataset of cities and build an api around it myself. I think fuzzy search capabilities would be a requirement. Are there any thoughts on what the best way to implement this would be, or is it better to just go with a robust existing API? I am building my web app with Express/NodeJS. Thanks for the help!
The best and easiest solution is to go with the Geocoding API from Google, since it is built having in mind the integration with other services from Google Maps.
It has a very simple setup process, you just create your geocoder which you feed give the input which has passed through the autocomplete from Places
Hope this helps! Best of luck!

Get play count of a track from Spotify API

Is it possible to get the play count of a song (for the current user)? I only found Toplist and the Track class, but neither tells me how often a user listened to a song.
As far as I know there is no way to retrieve that data at the moment.
This is not possible through the Spotify API right now.
The Last.fm API does offer information similar to this, as a potential work-around.
Marked as not right now on the Spotify support site.
http://community.spotify.com/t5/Spotify-Ideas/Personal-play-count-for-songs/idi-p/506618
However, this article from 538 a journalist got a look at Nestify where that information is available.
I would assume that the information would eventually be made available via the API.

Is possible to acces the waveform of a song from a spotify app?

I am thinking on how to build an spotify app that does beat detection (extract bpm of a song).
For that I need to access the raw audio, the waveform, and analyze it.
I am new to building spotify apps.
I know that with "libspotify" you can access raw audio. Can you do the same through the spotify apps API? And how?
For the record, currently exist two spotify apps apis:
Current
Preview
Unless you're really keen on writing that beat detection code yourself, you should look at the APIs provided by the EchoNest, which include that (and many other awesome things).
see Getting the tempo, key signature, and other audio attributes of a song
In a word: no. That isn't currently available in the Apps API.
There’s a new endpoint I guess. See an example https://medium.com/swlh/creating-waveforms-out-of-spotify-tracks-b22030dd442b?source=linkShare-962ec94337a0-1616364513
That uses the endpoint https://developer.spotify.com/documentation/web-api/reference/tracks/get-audio-analysis/
Edit: I agree with commenter #wizbcn that this does not answer this question. Is it sort of incorrect to leave it here because I found this SO post while searching for info about visualizing the tack's waveform as in the linked article? Maybe I should make this a comment instead?

Is there a way to find number of subscribers from a playlist URL?

I'm making a spotify app that I want to show the number of subscribers from a given playlist URL submitted by a user.
I have looked around their documentation but can't seem to find much useful information.
Thanks!
EDIT: I would like to use the web API as I don't really know C. Hopefully it's still possible.
The Web API doesn't support any playlist lookup at all, so unfortunately this isn't possible.
libSpotify supports this (see sp_playlist_num_subscribers), but be aware you need to have the user log into their Spotify account before this can be done, which may not be what you're wanting to do.

Why do I need a flickr api key?

Reading through the Flickr API documentation it keeps stating I require an API key to use their REST protocols. I am only building a photo viewer, gathering information available from Flickr's public photo feed (For instance, I am not planning on writing an upload script, where a API key would be required). Is there any added functionality I can get from getting a Key?
Update I answered the question below
To use the Flickr API you need to have an application key. We use this to track API usage.
Currently, commercial use of the API is allowed only with prior permission. Requests for API keys intended for commercial use are reviewed by staff. If your project is personal, artistic, free or otherwise non-commercial please don't request a commercial key. If your project is commercial, please provide sufficient detail to help us decide. Thanks!
http://www.flickr.com/services/api/misc.api_keys.html
We set up an account and got an API key. The answer to the question is, yes there is advanced functionality with an API key when creating something like a simple photo viewer. The flickr.photos.search command has many more features for reciving an rss feed of images than the Public photo feed, such as only retrieving new photos since the last feed request (via the min_upload_date attribute) or searching for "safe photos" only.
If you have a key, they can monitor your usage and make sure that everything is copacetic -- you are below request limit, etc. They can separate their stats on regular vs API usage. If they are having response time issues, they can make response a bit slower to API users in order to keep the main website responding quickly, etc.
Those are the benefits to them.
The benefits to you? If you just write a scraper, and it does something they don't like like hitting them too often, they'll block you unceremoniously for breaking their ToS.
If you only want to hit the thing a couple of times, you can get away without the Key. If you are writing a service that will hit their feed thousands of times, you want to give them the courtesy of following their rules.
Plus like Dave Webb said, the API is nicer. But that's in the eye of the beholder.
The Flickr API is very nice and easy to use and will be much easier than scraping the feed yourself.
Getting a key takes about 2 minutes - you fill in a form on the website and then email it to you.
Well, they say you need a key - you need a key, then :-) Exposing an API means you can pull data off the site way easier, it is understandable they want this under control. It is pretty much the same as with other API enabled sites.

Resources