Album search API return different results - api

I've got a different result when requesting the Deezer search API for an album from my production server:
for instance this search: http://api.deezer.com/search/album?q=Billy%20Ze%20kick%20et%20Les%20Gamins%20en%20Folie%20Billy%20Ze%20Kick%20et%20Les%20Gamins%20en%20Folie
-on my laptop in France, I've got 2 results and the album #215350 as first result
-on an heroku europe instance I've got 2 results, and the album #41910 as first result (absolutely no result if the heroku instance is in the US...)
-and on my production (digital ocean in Amsterdam) server I've got the album #41910 as one and only result.
I'm assuming there is a legal issue related on which country this album is available but is there any way to avoid this?
others similars APIs have a local attribute which allow me to see if the album is available in the country of my end user...
this is a real issue my server is in Amsterdam... my users are everywhere...
Any idea or solution?
Thanks!

Search results are localized based on the current user's country (IP based). You can override the country by passing a user token to the request to make sure you always get the same results.
About availability, it is track-based: if you want to know if the song is available in a country, you'll have to query each track from your album. For example, http://api.deezer.com/track/2150054 returns the list of available countries.

Related

aws Cloud search - short query

In my cloud search document I have list of persons I want to search in. Now, let's say there are a people with name David, Dan and Dennis. Everything works alright when I query full name (for example: David) - I get back all the persons with the name David. But what if I want to return all persons who's name starts with Da (so cloud search will leturn David, Dan and Dennis)? Is it possible to achieve this behaviour?
For context: I am building an application where user can search people by name (and some other attributes) and I don't want the user to have to type the full name of person to find...
Oh I found it. I need to use text prefiex:
https://docs.aws.amazon.com/cloudsearch/latest/developerguide/searching-text.html#searching-text-prefixes

Restrict Google Places API search by type

I am performing a query using Google Places API to search for local restaurants
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=..lat,..lon&radius=..radius&type=restaurant&key=..key
However, I am receiving a lot of results for locations that are not primarily restaurants, for example:
Popular hotels with restaurants
Food delivery services
Night clubs
Department stores with dining
etc.
Ideally I would like to restrict my query to only a few types or prohibit certain types by query. Otherwise I would need to do this manually or find another service.
Just add the city name as a prefix in the search string. It will only give the search suggestions in which the user is searching.
eg, pass "NewYork" as a prefix in your search string, now type any word, it will only give you results for NewYork city restaurant, cafes, places, etc

How to access weather data from all the stations in one country using openweathermap?

I am using Alteryx to extract weather data for a handful of cities and it works great. I'd like to expand this to able to download data for all weather stations in the UK. At the moment I am specifying which cities I want, e.g. London / Manchester.
Is there a way of specifying in the api call to download all stations in 'GB' or 'UK'?
Ideally I'd like to do this in one call rather than listing all locations which will be very laborious
Get a list of stations or cities that you want to retrieve weather data from. I found some good sources from openweather here: http://bulk.openweathermap.org/sample/
Then build a url request using the list of id's above that retrieves specific weather information. Using an id for the weather station in Cairns, id=2172797, the url ends up looking like:
http://api.openweathermap.org/data/2.5/weather?id=2172797&appid=843798874aac0ef138e6f77c72f3af80
Note that this url will return an error because this isn't a real appid. If you replace the appid with your own, this url will give you data for that station.
Putting this process into Alteryx lets you put the list of station id's together with the url and the appid to make many calls into openweather and then process all of the data together. I could not find information from the API on rate limits, so be conscious of how many requests you are posting to the service.
There is an example of this process here: https://www.dropbox.com/s/yoppbx3bw0p4rug/Get%20individual%20stations.yxzp?dl=0
Keep in mind that you have to update the Appid in the text input tool within this sample as well.

Query User by City using the Soundcloud Web API

Is it possible to fetch users by city or country? I would like to create something very local!
I've checked the available documentation but fail to see any solution to this, so this is a final stretch.
The City and Country properties are not searchable with the provided q parameter in the API, and as this searches over username / description and title you'd return a large number of false positives if it could.
It's unlikely you could over select as mentioned in the comments, as there are just too many users to pull down and then parse.

Get geo-locations from cities

I am trying to display a list of closest restaurants of a given city within a radius. In order to do this, I'll have to convert the city to a longitude/latitude.
When the user fills in his/her restaurant information, he/she will fill in the address. Based on that address i need to get a longitude/latitude and save that to the database.
I don't need to point this on a map. I'll be just displaying a list of all closest restaurants within the given radius to the user.
How can I do this with ASP.NET-MVC4?
Also, this project is based on Code First. And for address I have DbGeography as datatype set.
The project is kind of based on this tutorial
Edit
To avoid anyone else telling me this is not possible with ASP.NET on it's own, I am aware of that. an example with Google maps / .NET wrapper would be great.
This query itself is typically done in the database back-end because the program is the consumer of the data not the keeper of the data. You will have a table of restaurants, possibly for many cities, each restaurant having a latitude and longitude. You create a geospatial index on the table, which performs a tesselation for performance; you configure the tesselation parameters. You must determine the latitude/longitude of your restaurant-seeker's location. Your command object would feed that data to a stored procedure, along with the desired radius. The stored procedure would return an enumerable set of rows to your client program.
I found this .NET wrapper which fulfills my need.