How to handle deezer IDs vocabulary - deezer

each song can have different IDs in different countries (see Deezer APsI: example of non-streamable song for country limitation for detalis); having said that, which is the best practice to handle this in a deezer APIs based application?
Is there anything (like a "superID") which tells me that song A having ID 7 and song A having ID 8 are actually the same song?
As far as I have understood, the difference in catalog among countries shouldn't be huge so a song available in country X is usually available in all the other countries too in most of the cases...but considering the above difference in IDs vocabulary, is this still true? I.e. a song having ID 12345 in country X is available as 12345 in all the other countries in most of the cases?
Thanks.

Currently, the best practice is to use the readable flag on the JSON.
If you build your requests on client side (JS&co), the api geolocate the request with the client location.
If you build your requests on server side, the api use the geolocation of your server except if you use &access_token argument and the user is premium, the api use the geolocation of the subscription of the user.
No superID.
Yes, Most of the time, the identifiers are the same in all countries.

Related

Using international database on Google Books API

I've tested the Google Books API now with servers in a few different countries (Germany, UK, Netherlands; it should be in Europe) and realized that the results depend heavily on the request's origin region. For some German books (I search by ISBN) I get 20 or 30 results using the German server but nothing on the others and vice versa.
Is there any way to access the complete database Google has to offer? Note that I'm not trying to access anything like text excerpts or other critical content in terms of licensing. I only need the general information like Title, Authors, ISBN, ...
Thanks for your help!
I have the same problem. I found a paragraph in the documentation under "Using the API" (for Google books) that might explain it:
"Setting User Location:
Google Books respects copyright, contract, and other legal restrictions associated with the end user's location. As a result, some users might not be able to access book content from certain countries. For example, certain books are "previewable" only in the United States; we omit such preview links for users in other countries. Therefore, the API results are restricted based on your server or client application's IP address."
My workaround is to search while using a VPN - that returned the titles in English like I wanted to. If there's another way to solve it I'd gladly hear that too.

Why do I get a 30 second preview when requesting Flow radio for free users?

When streaming a single track on Deezer from the server side, how can Deezer recognize that this track came from Flow radio and therefore give a full streaming url for a free user? I seem to always receive a 30 second preview for free users, which we would like to avoid.
For the api to know that the track is within the subset of of a radio station (vs an on demand track), the api call needs to include the id of the station from which it came:
https://api.deezer.com/streaming_url.php?access_token=xxxx&radio_id=yyy&track_id=zzz
rather than simply:
https://api.deezer.com/streaming_url.php?access_token=xxxx&track_id=zzz

How do I fetch the facebook events of a particular location

I would like to fetch all the facebook events by passing a latitude or longitude or a place, As FQL support is no more, I've tried the following query
search?q=*&type=events&center=37.76,-122.427&distance=1000
But the results I get are from syria, India, USA, Hungary and all, why I'm not getting the events from only that location I've specified. Is there any legal issues in fetching the public events from facebook, How many number of eevnns I can fetch at a time??
There is no way to directly search for events in a specific area. The center and distance parameters are only available for Places, as you can read in the docs: https://developers.facebook.com/docs/graph-api/using-graph-api#search
More information:
https://www.facebook.com/help/community/question/?id=10201749749651827
How can I query public facebook events by location/city?
About "how many events can i fetch", those are the API rate limits: https://developers.facebook.com/docs/graph-api/advanced/rate-limiting
API results usually have a limit of 25 entries for one API call. But you can set it higher:
/search?type=event&q=test&limit=100
Legal issues depend on what you want to do with the data, impossible to say without knowing the details for your App.

Get EchoNest or Foreign ID from Beats Music ID?

I want to get EchoNest metadata for tracks coming from Beats Music. Beats has a certain track ID, and I am trying to find a way to connect that to a usable track ID for EchoNest, which takes Spotify IDs, MusicBrainz, etc.
Our track IDs are prefixed by us. Currently, there is no way to get information from EchoNest in this way.

Facebook APIs using checkins as an entry to raffle

I've been exploring ways that it might be possible to promote the business of a friend of mine. One of these ways is by encouraging users to check in to his business, the incentive for this being that they go into the draw to win some kind of prize.
I've been trying to find if the code for this already exists but I might be looking in the wrong places. If it doesn't what would be the best way to do it using the graph APIs.
Thanks.
You can use Facebook app to check-in to your page/business.
All page check-ins can be fetched using following request by your code
https://graph.facebook.com/PAGE_ID/checkins?access_token=PAGE_ACCESS_TOKEN
If you want to get only specific time period check-ins use since and until params in query.
You have to parse the json response and store in an array and randomly select the winner.
you can contact the winner using their facebook id and send them a message.
You will have to write the code yourself, but it would essentially work like this:
Get the user to allow access to the "Raffle" application and get their email address and permissions to look at their check-ins. Email is required to contact the winner.
Use a scheduled script (cronjob) to periodically check if the user has checked-in anywhere (in particular, the business you want to promote).
Award a raffle ticket for each unique check-in within a 24 hour period.
Hold a draw between all the users who checked in on that day or week and award the prize to someone randomly.
Pretty simple flow, but complex code.