Table of Contents

Class AutocompleteRequest

Namespace
GoogleMapsApi.Entities.PlacesNew.Request
Assembly
GoogleMapsApi.dll

Request for the Places API (New) Autocomplete endpoint (POST https://places.googleapis.com/v1/places:autocomplete). Modern replacement for the legacy Place Autocomplete.

public sealed class AutocompleteRequest : MapsBaseRequest
Inheritance
AutocompleteRequest
Inherited Members

Remarks

Properties

IncludedPrimaryTypes

Restrict predictions to these primary place types.

public List<string>? IncludedPrimaryTypes { get; set; }

Property Value

List<string>

IncludedRegionCodes

Restrict predictions to these region codes (CLDR).

public List<string>? IncludedRegionCodes { get; set; }

Property Value

List<string>

Input

Text typed by the user to predict against. Required.

public string Input { get; set; }

Property Value

string

LanguageCode

BCP-47 language code for the response (e.g. "en").

public string? LanguageCode { get; set; }

Property Value

string

LocationBias

Soft region bias for predictions.

public LocationBias? LocationBias { get; set; }

Property Value

LocationBias

LocationRestriction

Hard region restriction for predictions.

public LocationRestriction? LocationRestriction { get; set; }

Property Value

LocationRestriction

RegionCode

Unicode CLDR region code used for biasing/formatting (e.g. "US").

public string? RegionCode { get; set; }

Property Value

string

SessionToken

Autocomplete session token grouping requests for billing.

public string? SessionToken { get; set; }

Property Value

string

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 null for 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.