๐ Details
The Details feature provides access to rich, structured information about places.
It allows you to retrieve:
- ๐ General place metadata
- ๐ผ๏ธ Photos
- โญ Reviews
- ๐งช Raw JSON responses (advanced scenarios)
๐ Related Abstractionsโ
This feature is exposed through:
๐ See: IDetailsService
๐งฉ Serviceโ
public interface IDetailsService {
Task<PlaceDetails> GetDetailsAsync(string placeId);
Task<JsonDocument> GetDetailsRawAsync(string placeId, params string[] fields);
Task<IReadOnlyList<PlacePhoto>> GetPhotosAsync(string placeId, PhotoRequest? photoRequest = null);
Task<PlaceReviews> GetReviewsAsync(string placeId);
}
โ๏ธ Methodsโ
- GetDetailsAsync โ structured place data
- GetDetailsRawAsync โ raw JSON response
- GetPhotosAsync โ place photos
- GetReviewsAsync โ reviews and summaries
๐ง Notesโ
GetDetailsAsyncโ returns strongly-typed structured dataGetDetailsRawAsyncโ useful for unmapped fields and debugging (remember to dispose)GetPhotosAsyncโ supports optional configuration viaPhotoRequestGetReviewsAsyncโ includes both user reviews and optional AI summaries- Prefer strongly-typed methods for most scenarios
- Use raw JSON only for advanced/custom needs
- All methods are async and designed for high-performance API usage
โก Examplesโ
๐ Place Detailsโ
var details = await detailsService.GetDetailsAsync(placeId);
Console.WriteLine(details.DisplayName);
Console.WriteLine(details.FormattedAddress);
๐งพ Get Raw Details (Advanced)โ
using var json = await detailsService.GetDetailsRawAsync(
placeId,
"displayName",
"rating"
);
var root = json.RootElement;
โญ Get Reviewsโ
var reviews = await detailsService.GetReviewsAsync(placeId);
foreach (var review in reviews.Reviews) {
Console.WriteLine($"{review.AuthorName}: {review.Text}");
}
๐ธ Get Photosโ
var request = new PhotoRequestBuilder()
.WithMaximumPhotos(5)
.WithResolution(800, 800)
.Build();
var photos = await detailsService.GetPhotosAsync(placeId, request);
๐ฆ Modelsโ
PlaceDetailsโ
Represents detailed information about a place.
public sealed class PlaceDetails {
public string PlaceId { get; internal set; } = null!;
public string? DisplayName { get; internal set; }
public IReadOnlyList<string> Types { get; internal set; } = [];
public string? FormattedAddress { get; internal set; }
public string? GlobalCode { get; internal set; }
public LatLng? Location { get; internal set; }
public PostalAddress? PostalAddress { get; internal set; }
public string? TimeZone { get; internal set; }
public string? NationalPhoneNumber { get; internal set; }
public string? InternationalPhoneNumber { get; internal set; }
public string? PriceLevel { get; internal set; }
public float? Rating { get; internal set; }
public int? UserRatingCount { get; internal set; }
public IReadOnlyList<string> RegularOpeningHoursDaysDescriptions { get; internal set; } = [];
public GoogleMapsLinks? GoogleMapsLinks { get; internal set; }
public PaymentOptions? PaymentOptions { get; internal set; }
public ParkingOptions? ParkingOptions { get; internal set; }
}
๐ง Includesโ
- Basic info โ id, name, types, address (formatted and detailed -> see PostalAddress)
- Location โ timezone, coordinates exposed by LatLng Core object
- Contact โ phone numbers
- Ratings โ score, user count and price level
- Extras
- Opening hours
- Links -> see GoogleMapsLinks,
- Payments -> see PaymentOtions,
- Parking -> see ParkingOptions
PlacePhotoโ
Represents a photo associated with a place.
public sealed class PlacePhoto {
public Uri Uri { get; internal set; } = null!;
public string Name { get; internal set; } = null!;
public string? AuthorName { get; internal set; }
public int? HeightPx { get; internal set; }
public int? WidthPx { get; internal set; }
}
PlaceReviewsโ
Represents reviews and summary information for a place.
public sealed class PlaceReviews {
public string PlaceId { get; internal set; } = null!;
public string DisplayName { get; internal set; } = null!;
public IReadOnlyList<Review> Reviews { get; internal set; } = [];
public ReviewSummary? ReviewSummary { get; internal set; }
public string? ReviewsUri { get; internal set; }
}
๐ง Includesโ
- Individual user reviews -> see Review
- Optional AI-generated summary -> see ReviewSummary
- Link to Google Maps reviews
Raw JSON Accessโ
- Useful for unmapped fields
- Useful for debugging
โ ๏ธ JsonDocument is disposable
using var json = await details.GetDetailsRawAsync(placeId);
๐งฐ Componentsโ
These models provide additional structured information used within PlaceDetails and PlaceReviews.
- These models are optional and context-dependent
- Values may be null depending on API response
- Designed to keep both
PlaceDetailsandPlaceReviewsclean and modular
PostalAddressโ
Represents a structured postal address. Used in PlaceDetails
public sealed class PostalAddress {
public string? RegionCode { get; internal set; }
public string? PostalCode { get; internal set; }
public string? AdministrativeArea { get; internal set; }
public string? Locality { get; internal set; }
public IReadOnlyList<string> AddressLines { get; internal set; } = [];
}
โ๏ธ Propertiesโ
| Property | Description |
|---|---|
RegionCode | Country/region code |
PostalCode | ZIP/postal code |
AdministrativeArea | State/province |
Locality | Sity |
AddressLines | Formatted address lines |
GoogleMapsLinksโ
Represents useful Google Maps-related links. Used in PlaceDetails
public sealed class GoogleMapsLinks {
public string? WebsiteUri { get; internal set; }
public string? GoogleMapsUri { get; internal set; }
public string? PlaceUri { get; internal set; }
public string? WriteAReviewUri { get; internal set; }
public string? ReviewsUri { get; internal set; }
public string? PhotosUri { get; internal set; }
}
โ๏ธ Propertiesโ
| Property | Description |
|---|---|
WebsiteUri | Official website |
GoogleMapsUri | Maps view |
PlaceUri | Direct place page |
WriteAReviewUri | Review submission link |
ReviewsUri | Reviews page |
PhotosUri | Photos page |
PaymentOptionsโ
Represents supported payment methods. Used in PlaceDetails
public sealed class PaymentOptions {
public bool? AcceptsCreditCards { get; internal set; }
public bool? AcceptsDebitCards { get; internal set; }
public bool? AcceptsCashOnly { get; internal set; }
public bool? AcceptsNfc { get; internal set; }
}
โ๏ธ Propertiesโ
| Property | Description |
|---|---|
AcceptsCreditCards | Credit card support |
AcceptsDebitCards | Debit card support |
AcceptsCashOnly | Cash-only business |
AcceptsNfc | Contactless payments |
ParkingOptionsโ
Represents parking availability. Used in PlaceDetails
public sealed class ParkingOptions {
public bool? FreeParkingLot { get; internal set; }
public bool? FreeStreetParking { get; internal set; }
}
โ๏ธ Propertiesโ
| Property | Description |
|---|---|
FreeParkingLot | Dedicated parking lot |
FreeStreetParking | Street parking available |
Reviewโ
Represents a single user review. Used in PlaceReviews
public sealed class Review {
public string Text { get; internal set; } = null!;
public float? Rating { get; internal set; }
public string? AuthorName { get; internal set; }
public DateTimeOffset? PublishTime { get; internal set; }
public string LanguageCode { get; internal set; } = null!;
}
โ๏ธ Propertiesโ
| Property | Description |
|---|---|
Text | Review content |
Rating | User rating |
AuthorName | Reviewer name |
PublishTime | When the review was published |
LanguageCode | Review language |
ReviewSummaryโ
Represents an AI-generated summary of reviews (optional and may not always be present). Used in PlaceReviews
public sealed class ReviewSummary {
public string Text { get; internal set; } = null!;
public string LanguageCode { get; internal set; } = null!;
}
โ๏ธ Propertiesโ
| Property | Description |
|---|---|
Text | summarized sentiment |
LanguageCode | Summary language |
๐งพ Requestโ
PhotoRequestโ
Represents the configuration used when requesting photos for a place.
public sealed class PhotoRequest {
public int MaxPhotos { get; internal set; } = 10;
public int MaxHeightPx { get; internal set; } = 480;
public int MaxWidthPx { get; internal set; } = 480;
}
โ๏ธ Propertiesโ
| Property | Description |
|---|---|
MaxPhotos | Maximum number of photos to retrieve (default: 10) |
MaxHeightPx | Maximum height in pixels (default: 480) |
MaxWidthPx | Maximum width in pixels (default: 480) |
๐ง Notesโ
- Must be constructed using
PhotoRequestBuilder
PhotoRequestBuilderโ
Provides a fluent API for constructing PhotoRequest instances.
public sealed class PhotoRequestBuilder {
public PhotoRequestBuilder WithMaximumPhotos(int maxPhotos);
public PhotoRequestBuilder WithResolution(int maxHeight, int maxWidth);
public PhotoRequest Build();
}
โ๏ธ Configurationโ
WithMaximumPhotos(int)โ limits number of photos (1โ10)WithResolution(int, int)โ sets max height & width (1โ4096 px)
๐ง Notesโ
- Defaults are applied if no configuration is provided:
- 10 photos
- 480x480 resolution
- Validation is enforced through MapsInvalidRequestException
- Designed to keep photo requests safe and within API limits