13

I am trying to use the Google places API to get information on certain places. I have an

example from Google search:

example from Google search

here of what I am trying to find. I thought that the "types" field of the Places API text search would contain it, but this text appears to be different and not within the provided list of options. If anyone can provide some info on where this comes from and how to obtain it, it would be much appreciated. Thanks

3 Answers 3

12

Currently you cannot obtain this data via Places API. There is a feature request in Google issue tracker to make the detailed business type available in Places API, however Google doesn't expose any ETA:

https://issuetracker.google.com/issues/35822953

Feel free to star this feature request to express your interest and subscribe to notification from Google.

1
  • 2
    Have they still not released this in the places API? seems like this issue is over 5 years old.
    – leo
    Commented Sep 3, 2019 at 13:57
0

According to Google Places SDK to Android:

Since September 24, 2015 we have:

This release adds three new methods to AutocompletePrediction, giving you easy access to the primary and secondary parts of the place description as well as the full text of the description. This is useful, for example, when you want to display a short title followed by further detail about the place. See the sample code on GitHub. The new methods are as follows:

getFullText(CharacterStyle matchStyle) returns the full text of a place description. This is a combination of the primary and secondary text. Example: "Eiffel Tower, Avenue Anatole France, Paris, France".

This method is equivalent to the existing getDescription() method. In addition, it lets you highlight the sections of the description that match the search with a style of your choice, using CharacterStyle. The CharacterStyle parameter is optional. Set it to null if you don't need any highlighting.

getPrimaryText(CharacterStyle matchStyle) returns the main text describing a place. This is usually the name of the place. Examples: "Eiffel Tower", and "123 Pitt Street".

getSecondaryText(CharacterStyle matchStyle) returns the subsidiary text of a place description. This is useful, for example, as a second line when showing autocomplete predictions. Examples: "Avenue Anatole France, Paris, France", and "Sydney, New South Wales".

Accompanying the above improvement, the following methods on AutocompletePrediction, are now deprecated:

getDescription() is now deprecated.

Please use getFullText(), getPrimaryText(), and/or getSecondaryText() to retrieve the full or partial description, getMatchedSubstrings() is now deprecated. Please use getFullText() to format matches more easily.

0

Since November 1st 2023, this feature is included in the new Google Places API (as per the thread in the issuetracker xomena mentioned above).

The new API introduces many changes to the response Place object, including two new fields to represent the primary type of each place:

  • primaryTypeDisplayName for the Place's primary type as a localized text string.

  • primaryTypeName for the Place's primary type, as it is found in the types array.

Not the answer you're looking for? Browse other questions tagged or ask your own question.