Class SearchTextRequest
- Namespace
- GoogleMapsApi.Entities.PlacesNew.Request
- Assembly
- GoogleMapsApi.dll
Request for the Places API (New) Text Search endpoint
(POST https://places.googleapis.com/v1/places:searchText). Modern replacement for the
legacy Places Text Search.
public sealed class SearchTextRequest : MapsBaseRequest
- Inheritance
-
SearchTextRequest
- Inherited Members
Remarks
The Places API (New) requires a field mask. FieldMask is
pre-populated with a reasonable default using places.-prefixed paths; tighten it to
reduce response size and cost. See
https://developers.google.com/maps/documentation/places/web-service/text-search.
Fields
DefaultFieldMask
Default FieldMask covering a commonly useful set of place fields.
public const string DefaultFieldMask = "places.id,places.displayName,places.formattedAddress,places.location,places.rating,places.types,places.googleMapsUri"
Field Value
Properties
FieldMask
Comma-separated response field mask using places.-prefixed paths.
Required by the Places API (New). Passed in the URL as $fields.
public string FieldMask { get; set; }
Property Value
IncludedType
Restricts results to a single place type (e.g. "restaurant").
public string? IncludedType { get; set; }
Property Value
LanguageCode
BCP-47 language code for the response (e.g. "en").
public string? LanguageCode { get; set; }
Property Value
LocationBias
Soft region bias for results.
public LocationBias? LocationBias { get; set; }
Property Value
LocationRestriction
Hard region restriction for results.
public LocationRestriction? LocationRestriction { get; set; }
Property Value
MinRating
Filter out places with a rating below this value (1.0–5.0).
public double? MinRating { get; set; }
Property Value
OpenNow
If true, return only places that are open now.
public bool? OpenNow { get; set; }
Property Value
- bool?
PageSize
Maximum number of results per page (1–20).
public int? PageSize { get; set; }
Property Value
- int?
PageToken
Page token from a previous response, to fetch the next page.
public string? PageToken { get; set; }
Property Value
PriceLevels
Restrict results to the given price levels.
public List<PriceLevel>? PriceLevels { get; set; }
Property Value
RankPreference
How results should be ranked.
public RankPreference? RankPreference { get; set; }
Property Value
RegionCode
Unicode CLDR region code used for biasing/formatting (e.g. "US").
public string? RegionCode { get; set; }
Property Value
TextQuery
Free-text query (e.g. "pizza in New York"). Required.
public string TextQuery { get; set; }
Property Value
Methods
GetRequestBody()
Builds the body to send with this request, or null for endpoints that use GET with
query-string parameters only. Derived requests that target POST-based endpoints (for example,
Address Validation) override this to return a JSON HttpContent; when the engine
sees a non-null body it issues a POST instead of a GET.
protected override HttpContent? GetRequestBody()
Returns
- HttpContent
The HTTP content to send, or
nullfor a GET request.
GetUri()
Builds the absolute request URI, including scheme, base URL, and serialized query-string parameters.
public override Uri GetUri()
Returns
- Uri
The fully composed URI to send to the Google Maps API.