Why am I not receiving any images from the HERE Places (Search) API? - here-api

I'm trying to get images for restaurants using the HERE Places (Search) API.
I'm using the "Browse" entrypoint, and then using the href in there to get a restaurant's details. In it, I keep on getting this:
media: {
images: {
available:0
items: [ ]
}
The same for reviews and ratings.
Based on other posts here, I'm confused what the problem is, as one post seemingly says its a bug, and one post seemingly says it's just the way the API is.

First of all, "HERE Places API" is deprecated. You should migrate to "HERE Geocoding and Search API v7". Check this out https://developer.here.com/documentation/geocoding-search-api/migration_guide/index.html
As already explained in this question
Include Review,Rating and Images in places API , the API will return the place IDs of external suppliers (TripAdvisor, Yelp etc). This is true also for the latest "HERE Geocoding and Search API v7". With these IDs, you can retrieve other details (such images, reviews, etc) from external system APIs.

Related

Here SDK flutter does not show places image. Always returns no data for images

I am new to "Here" and I am using Here SDK Flutter 4.3.3.0. I want to fetch/search for places and get the Place's Photos/Image and or Place's Logo if the place is a business/company.
The place images place.details.internalimages are always empty when I search for any place. I tried for different countries like "Chipotle" a restaurant near Las Vegas, a restaurant in Canda, and a Shopping mall in India. All of these return 0 (zero) images. Does, Here API support to get places photos like Google Places or TomTom API?
Looks like this API has a method to get WebImage List but does not contain any data at all. Please advise, If I need to use any other method to get Place's photos.
Another question is, is there a way to get a company logo, if the place I am searching for is a business/company like Restaurant, Store, etc.
Below is the code, I use in my Flutter application. Note, I am able to get other field values like title, address, etc.
TextQuery textQuery = TextQuery.withAreaCenterInCountries('some partial place name', geoCoordinates, countryCodes);
searchEngine.suggest(textQuery, searchOptions, onHereSearchSuggestionCompleted);
In onHereSearchSuggestionCompleted functions, I have the following code:
if(suggestions.length > 0){
print('explore - onHereSearchSuggestionCompleted - suggestions count > 0');
for (Suggestion suggestion in suggestions) {
print('onHereSearchSuggestionCompleted - current count = ${(suggestions.indexOf(suggestion) + 1)}');
print('onHereSearchSuggestionCompleted - suggestion title = ${suggestion.title}');
print('onHereSearchSuggestionCompleted - place id = ${suggestion.place.id}');
print('onHereSearchSuggestionCompleted - place title = ${suggestion.place.title}');
print('onHereSearchSuggestionCompleted - place address = ${suggestion.place.address.addressText}');
print('onHereSearchSuggestionCompleted - place img length = ${suggestion.place.details.internalimages.length}');
}
}
Please note, you have been able to see this functionality being exposed in flutter SDK due to a bug exposing internal methods in flutter. In general this functionality is not yet public (not in native android and iOS).
We plan to expose this functionality soon, however even when we do, only certain eligible customers would have access to the image content. There should be contractual agreement to be able to see this functionality

Wordpress ACF Google maps field API Key

I have a Wordpress project with Advanced Custom Fields Pro 5.3.5 plugin, where for one of my post types I set an address field using the Google Map field type. When I go to the admin page to add/edit a post this Google Maps field shows the map but in "For development purposes only" mode.
It's probably missing an API key. I'm trying to set it as described in their documentation:
// Method 1: Filter.
function my_acf_google_map_api( $api ){
$api['key'] = 'xxx';
return $api;
}
add_filter('acf/fields/google_map/api', 'my_acf_google_map_api');
// Method 2: Setting.
function my_acf_init() {
acf_update_setting('google_api_key', 'xxx');
}
add_action('acf/init', 'my_acf_init');
I tried both methods in the functions.php of my theme and none work. I made sure that the API Key I'm using is valid and it is, I can use it on Postman to make API keys without any problem.
I've seen similar questions here on StackOverflow and basically the answer is what I'm already trying. What else I'm missing?
Thanks for any help
I've just had similar issues and hopefully my solution/steps will help.
As mentioned in the comments by #evan multiple API's must be enabled in the Google Console otherwise you will get errors.
Read the Error/Console message(s)! It will point you to either Billing or which API is not available/active.
Troubleshooting
Must have Google Console Project hooked up to a billing account
Must enable multiple APIs
(optional) can restrict key to certain domain/IPs
and also restrict to certain API
For the admin to work I required Maps Javascript API, Places API and also Geolocation API to be 'Enabled'
With those enabled my Admin could lookup and correctly assign Map lat/lng fields to the ACF field and saved correctly.

Meteor: Single-Document Subscription

Whenever I encounter code snippets on the web, I see something like
Meteor.subscribe('posts', 'bob-smith');
The client can then display all posts of "bob-smith".
The subscription returns several documents.
What I need, in contrast, is a single-document subscription in order to show an article's body field. I would like to filter by (article) id:
Meteor.subscribe('articles', articleId);
But I got suspicious when I searched the web for similar examples: I cannot find even one single-document subscription example.
What is the reason for that? Why does nobody use single-document subscriptions?
Oh but people do!
This is not against any best practice that I know of.
For example, here is a code sample from the github repository of Telescope where you can see a publication for retrieving a single user based on his or her id.
Here is another one for retrieving a single post, and here is the subscription for it.
It is actually sane to subscribe only to the data that you need at a given moment in your app. If you are writing a single post page, you should make a single post publication/subscription for it, such as:
Meteor.publish('singleArticle', function (articleId) {
return Articles.find({_id: articleId});
});
// Then, from an iron-router route for example:
Meteor.subscribe('singleArticle', this.params.articleId);
A common pattern that uses a single document subscription is a parameterized route, ex: /posts/:_id - you'll see these in many iron:router answers here.

Obtaining topic description in search api

I seem to be having problem pulling out the text content of the following query without making another call:
http://tinyurl.com/mgsewz2 via the mqlread api
{
"id": "/en/alcatraz_island",
"/common/topic/description": [{}],
"/common/topic/topic_equivalent_webpage": [],
"/common/topic/official_website": null
}
I can't retrieve the following
description
equivalent webpage (I'm looking for the en wiki page)
, but I can obtain the official_website url.
It looks like I can get it via the search api via output= but I can't walk through the entire set that I'm looking for without getting search request is too large error.
http://markmail.org/message/hd6pcveta7bhuz25#query:+page:1+mid:u7xegxlhtmhwiqbl+state:results
Thanks!
It you want to download large subsets of Freebase data, your best bet is to use the Freebase RDF Dumps. They contain all the properties that you listed above.

Freebase query for full topic summary

I'm trying to retrieve the full topic description/summary for some Freebase articles. I have been using the Freebase topic API, which returns this type of results: http://www.freebase.com/experimental/topic/standard?id=/en/jimi_hendrix
But I notice that the description is not complete and ends with "...". Is there a way to use some Freebase API to obtain the article's full description?
Does Freebase even store the complete description or does it just stores a portion of the description from Wikipedia?
Freebase just stores a portion of the Wikipedia description but there is usually more than what's given by the topic API.
To get the "full" text for a Wikipedia blurb associated with a Freebase topic you first need to query the Read API for a list of related articles like this:
{
"id": "/en/jimi_hendrix",
"/common/topic/article": [{}]
}​
Try it in the Query Editor
Then choose one or more of the articles that it returns and feed its ID into the /trans/raw API like this:
http://api.freebase.com/api/trans/raw/m/043dz
You'll notice that the blurb of text that gets returned is a bit longer (1200 chars) and doesn't have the "..." but its still chopped off at the end.
When I display Freebase topic descriptions in a web page I have some code to clean it up before hand. I split it apart into paragraphs by looking for newlines and then if the last paragraph doesn't end with a period, exclamation mark or question mark I just throw away that paragraph. The way the Wikipedia blurbs are written, you usually only need the first paragraph anyways.
You can also fetch this directly from MQL with the "text" extension:
{
"id": "/en/jimi_hendrix",
"/common/topic/article": [{
"text": {
"maxlength": 16384,
"chars": null
}
}]
}​
Note that you'll need to turn on MQL extensions for this to work - see here for an example of this in action.
Edit August 2012: while this works for the original freebase.com hosted APIs, the MQL extension functionality has been removed from the new googleapis.com hosted APIs, so this method shouldn't be relied on any more.

Resources