Can Bing Search API V5 search for non english news articles - microsoft-cognitive

I attempted the following search on Bing Search API, limiting to News articles only:
$ms_api_url = "https://api.cognitive.microsoft.com/bing/v5.0/news/search?q=حج";
and
$ms_api_url = "https://api.cognitive.microsoft.com/bing/v5.0/news/search?q=%27%D8%AD%D8%AC%27"
and the results were very limited (55 articles) and nearly all English.
Can this API return non-english results?

mkt is an optional parameter to specify where the results are coming from. From the documentation:
Typically, this is the country where the user is making the request
from; however, it could be a different country if the user is not
located in a country where Bing delivers results. The market must be
in the form {language code}-{country code}. For example, en-US.
Full list of supported markets:
es-AR,en-AU,de-AT,nl-BE,fr-BE,pt-BR,en-CA,fr-CA,es-CL,da-DK,fi-FI,fr-FR,de-DE,zh-HK,en-IN,en-ID,en-IE,it-IT,ja-JP,ko-KR,en-MY,es-MX,nl-NL,en-NZ,no-NO,zh-CN,pl-PL,pt-PT,en-PH,ru-RU,ar-SA,en-ZA,es-ES,sv-SE,fr-CH,de-CH,zh-TW,tr-TR,en-GB,en-US,es-US

Related

What's the meaning of "ceid" in Google News url

I am recently working on web scraping of Google News and dealing with the URL format. I have same question of this post about the meaning of ceid.
For example the link from the post: https://news.google.com/rss/search?q=studie&hl=de&gl=DE&ceid=DE:de
I know hl = host language, gl = for the search results whose country of origin matches the parameter value, but I can't find what ceid for. If I cut that part of the search link, it is unable to show the result, so obviously it is a must part.
So what's the meaning and the purpose of the "ceid"?
Many thanks.
It might mean the country name and show the results according to the common language of the country.
For example: 'ceid=IN:en' means the country as "India", and hence the result should show up in English.

Google Places API: How to go from address to "good" place_id?

On the google places api site, they have an example query that returns a load of detail:
site:
https://developers.google.com/places/web-service/details
query:
https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJN1t_tDeuEmsRUsoyG83frY4&key=My-API-Key
Place_id appears to be the key here. So I'm trying to reverse-engineer this example, starting from information that a human being would actually have, to end up with this place_id.
Address from the example:
48 Pirrama Rd, Pyrmont NSW 2009, Australia
Places API query from the address:
https://maps.googleapis.com/maps/api/place/textsearch/json?query=48+Pirrama+Rd,+Pyrmont+NSW+2009,+Australia&key=My_API_Key
The result contains a different place_id:
ChIJ8UadyjeuEmsRDt5QbiDg720
And the place details with that place_id are much poorer than the original example:
https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJ8UadyjeuEmsRDt5QbiDg720&key=My-API-Key
So what am I missing here? How do I start from human-place information and get to the place_id that has the great place details?
EDIT: why the down votes? Am I trying to do something that isn't allowed?
Thanks,
sff
I think your text search is returning the office building, whereas your first search is returning the Google office within the office building. You can fix your text search by adding the name of the company and removing some of the search terms.
I'm not sure why just adding 'google' to the search term doesn't return the result you want though.

Google places api not showing results for some places

Hello i am using simple google map places api to get near by atms for users. My client lives around new york and for some strange reason api shows zero results for that place, but works fine near me (pakistan) . I searched for it a little and found out it was google's issue and some other places were also experiencing the same problem. But i never quite found any solution for this.
This is the get call i use
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=40.7128,74.1059&radius=10000000&keyword=atm&key=MY_KEY
I would really appreciate the help. Thank you :)
Google place nearby search maximum 50,000 meters (31 miles) . if you try enter more than 50,000 it not work proper.
There is another way for find all ATM in a city. google provide Text Search Requests
https://maps.googleapis.com/maps/api/place/textsearch/json?query=atm+in+Reno,NV,89501,USA&key={API_KEY}
query = keyword + in + city Name
for get city name using latitude longitude
http://maps.googleapis.com/maps/api/geocode/json?latlng=39.52963,-119.81380&sensor=true
For more information how to get city name using latitude longitude
https://developers.google.com/maps/documentation/geocoding/start?csw=1#ReverseGeocoding
for more information about how to use Text Search Requests
https://developers.google.com/places/web-service/search
OR (second way)
There is another way for find all ATM in a city.
Open Google Maps .
create 10-12 or more points latitude , longitude value to trigger
request.
Then use a loop to find all places within these points.
If you want more appropriate results, increase first trigger points
for your requests.
- It is just a logic i created in php.
$triggerPoints = array("lat1,long1", "lat2,long2", "lat3,long3",....);
foreeach(triggerPoints as $tP){
$requestUrl = "https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=$tP&radius=[YOUR_RADIUS_VALUE]&type=[YOUR_TYPE]&name=panera&key=[YOUR_KEY_HERE";
$results = file_get_contents($requestUrl);
//Do what you want with response JSON data
}
SHORT ANSWER: Use logical types with your needs.
In my case i used food types instead of supermarket. In some cases, my local market named A101 wasnt found under supermarkets. To find which keywords is best for you, you can search below url with your location and map_key and find most common keywords under types for each query and use it.
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=40.986527896166244,%2029.24326049097467&rankby=distance&keyword=a101&key=YOUR_MAP_KEY

What is a valid format for params in news bing url?

I'm trying to add some filters to request for news in bing api but currently I don't get any effects of doing this ( for example filter for news from current month).
I'm trying to this with : https://api.cognitive.microsoft.com/bing/v5.0/news/search?freshness=month&?category=business , and replacing some filters here but I always getting the same result.
Currently i want to add three filters : freshness, category and language for news from current day and month.
So it is bug or I'm doing something wrong with filters ?
One problem is that you have an extra "?" in your query. You only need the first one, and then you can use "&" to delimit individual parameters:
https://api.cognitive.microsoft.com/bing/v5.0/news/search?freshness=month&category=business
You might also try adding a market to the query string, like so:
https://api.cognitive.microsoft.com/bing/v5.0/news/search?freshness=month&category=business&mkt=en-us
I'm using 7.0 and don't know what headers you're passing, so I can't test this directly, but it's possible a default market isn't being set. Since categories are market specific, then depending on how Bing handles this, it could plausibly prevent your category from being used.

How does Google Maps decide when to use a specific icon?

I am using the Google Maps Places library to do a search for nearby hospitals, but it returns results that aren't necessary hospitals (but have 'hospital' as one of their types). However, I've noticed that actual hospitals have a hospital icon on the map, so Google must somehow know which establishments are actually hospitals. Does anyone know if the public has access to this data?
This is the icon I'm referring to: https://www.dropbox.com/s/1jfqcayxavjhlyi/Screenshot%202015-03-17%2017.20.19.png?dl=0
Example of request I'm making:
var request = {
location: self.location,
radius: 20000,
types: ['hospital'],
keyword: 'hospital'
};
Example result that isn't a hospital:
{"geometry":{"location":{"k":44.815958,"D":-68.808244}},
"icon":"http://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png","id":"de6e60bd70b90ba4cb86afe149a60169553607f1",
"name":"Penobscot Community Health Center",
"opening_hours":{"open_now":true,"weekday_text":[]},
"photos":[{"height":320,"html_attributions":[],"width":320}],"place_id":"ChIJj--4INRKrkwRN0z2XkoJtVU",
"rating":3.1,
"reference":"CoQBdAAAADmf3YA0659efzMbCSPOK6SZttkfus7aWBDhrZZyX63Szl256BRcpz81LH6rIuONldYv256tsN7Zv-N6ZkOkJadlD2VS01bs7C4ierKvGUMyJOJu657xL5MvidF3Tgs9iejeJcXsxjDJYOwtN3m3sbfClfWYVnnIL4hMLYV8P9TnEhBurfJv_30CAG2wp1V73POVGhR-7fz1mCdh4OYWSa3Pw0mPupckoQ",
"scope":"GOOGLE",
"types":["hospital","pharmacy","store","health","establishment"],
"vicinity":"1012 Union Street, Bangor",
"html_attributions":[]}
My guess is there are a couple ways to get around this. You might remove the keyword argument from the API, which acts like a search term rather than a specific match on a type of location like the type field does.
You may want to be careful about your radius value choice.
Next, if you do a search on Google Maps in general you'll get a broad assortment of results. Do you need every result to be an actual hospital or can you do your own filtering afterwards?
If you do your own filtering it looks like type information and even icons are embedded in the result JSON. You might see if there's a distinguishing characteristic between the types of results you want and filter by that. Otherwise, any additional graphical data would not be accessible via the API.

Resources