Skip to main content

Place details

Place details returns everything the SDK maps about one place: address, location, contact data, rating, opening hours, links and amenities. You need its place ID, from a search or an autocomplete suggestion.

Example​

using AarxMaps.Places.Services.Details;

var request = new DetailsRequestBuilder()
.WithPlaceId("ChIJN1t_tDeuEmsRUsoyG83frY4")
.Build();

var details = await places.Details.GetDetailsAsync(request, ct);

Console.WriteLine($"{details.DisplayName}, {details.FormattedAddress}");
Console.WriteLine($"Rating {details.Rating} from {details.UserRatingCount}");

Options​

DetailsRequestBuilder builds the DetailsRequest that every Details method takes, including photos and reviews:

MethodRequiredRule
WithPlaceIdYesNot blank; trimmed
WithSessionTokenNoEnds an autocomplete session

Set the session token on exactly one Details call: the one that ends the user's search. See Autocomplete.

Result​

PlaceDetails, most-used properties:

PropertyTypeNotes
DisplayNamestring?Name in the configured language
FormattedAddressstring?One-line address
LocationLatLng?See Coordinates
Ratingfloat?Average rating
UserRatingCountint?Number of ratings
OpeningHoursIReadOnlyList<string>One line per weekday
WebsiteUriUri?
InternationalPhoneNumberstring?
All properties
PropertyType
PlaceIdstring
DisplayNamestring?
TypesIReadOnlyList<string>
FormattedAddressstring?
GlobalCodestring? (plus code)
LocationLatLng?
PostalAddressPostalAddress?
TimeZonestring? (IANA ID)
NationalPhoneNumberstring?
InternationalPhoneNumberstring?
PriceLevelPriceLevel?
Ratingfloat?
UserRatingCountint?
OpeningHoursIReadOnlyList<string>
WebsiteUriUri?
GoogleMapsLinksGoogleMapsLinks
PaymentOptionsPaymentOptions?
ParkingOptionsParkingOptions?
Nested types

PostalAddress: RegionCode, PostalCode, AdministrativeArea, Locality (all string?) and AddressLines (IReadOnlyList<string>).

GoogleMapsLinks is never null, but each of its links can be: GoogleMapsUri, DirectionsUri, PlaceUri, WriteAReviewUri, ReviewsUri, PhotosUri (all Uri?).

PaymentOptions: AcceptsCreditCards, AcceptsDebitCards, AcceptsCashOnly, AcceptsNfc (all bool?).

ParkingOptions: FreeParkingLot, FreeStreetParking (both bool?).

PriceLevel (enum): Free, Inexpensive, Moderate, Expensive, VeryExpensive. PlaceDetails.PriceLevel is null when Google doesn't report one.

  • Every Uri is http or https; anything else is null, so links are safe to render.

Billing​

GetDetailsAsync always asks Google for the same field set, which includes contact, rating, opening hours and amenity fields. Google bills that as Place Details Enterprise + Atmosphere, its highest tier. If you need fewer fields, use the raw method below with only those fields to pay a lower tier. See Google's data fields page.

Raw JSON​

GetDetailsRawAsync returns Google's JSON for the fields you name, including fields the SDK doesn't map:

using AarxMaps.Core.Extensions;
using AarxMaps.Places.Services.Details;

var request = new DetailsRequestBuilder().WithPlaceId(placeId).Build();

using var json = await places.Details.GetDetailsRawAsync(
request, ["displayName", "rating", "editorialSummary"], ct);

var rating = json.RootElement.GetDoubleValue("rating");
var summary = json.RootElement
.GetObject("editorialSummary")?
.GetStringValue("text");
  • Field names are Google's Place fields in camelCase, with dots for nested fields. "*" asks for every field, at the highest price.
  • Names are trimmed and duplicates removed. A null or empty list, or a blank name, throws MapsInvalidRequestException; an unknown name is rejected by Google with a 400.
  • The JsonElement helpers (GetDoubleValue, GetObject, ...) are described on Custom endpoints.
  • Responses are cached like other calls, unless the fields include photos ("photos", "photos.*" or "*").
Dispose the document

The caller owns the JsonDocument. Use using var json = .... Every call returns a new document, even from the cache.

Rules and errors​

  • No place with that ID: MapsNotFoundException (404).
  • A malformed place ID: MapsInvalidRequestException (400 from Google).
  • Build() without WithPlaceId, or a blank ID: MapsInvalidRequestException from the builder.

See also​