GetPlaceCommand

Finds a place by its unique ID. A PlaceId is returned by other place operations.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { GeoPlacesClient, GetPlaceCommand } from "@aws-sdk/client-geo-places"; // ES Modules import
// const { GeoPlacesClient, GetPlaceCommand } = require("@aws-sdk/client-geo-places"); // CommonJS import
const client = new GeoPlacesClient(config);
const input = { // GetPlaceRequest
  PlaceId: "STRING_VALUE", // required
  AdditionalFeatures: [ // GetPlaceAdditionalFeatureList
    "STRING_VALUE",
  ],
  Language: "STRING_VALUE",
  PoliticalView: "STRING_VALUE",
  IntendedUse: "STRING_VALUE",
  Key: "STRING_VALUE",
};
const command = new GetPlaceCommand(input);
const response = await client.send(command);
// { // GetPlaceResponse
//   PlaceId: "STRING_VALUE", // required
//   PlaceType: "STRING_VALUE", // required
//   Title: "STRING_VALUE", // required
//   PricingBucket: "STRING_VALUE", // required
//   Address: { // Address
//     Label: "STRING_VALUE",
//     Country: { // Country
//       Code2: "STRING_VALUE",
//       Code3: "STRING_VALUE",
//       Name: "STRING_VALUE",
//     },
//     Region: { // Region
//       Code: "STRING_VALUE",
//       Name: "STRING_VALUE",
//     },
//     SubRegion: { // SubRegion
//       Code: "STRING_VALUE",
//       Name: "STRING_VALUE",
//     },
//     Locality: "STRING_VALUE",
//     District: "STRING_VALUE",
//     SubDistrict: "STRING_VALUE",
//     PostalCode: "STRING_VALUE",
//     Block: "STRING_VALUE",
//     SubBlock: "STRING_VALUE",
//     Intersection: [ // IntersectionList
//       "STRING_VALUE",
//     ],
//     Street: "STRING_VALUE",
//     StreetComponents: [ // StreetComponentsList
//       { // StreetComponents
//         BaseName: "STRING_VALUE",
//         Type: "STRING_VALUE",
//         TypePlacement: "STRING_VALUE",
//         TypeSeparator: "STRING_VALUE",
//         Prefix: "STRING_VALUE",
//         Suffix: "STRING_VALUE",
//         Direction: "STRING_VALUE",
//         Language: "STRING_VALUE",
//       },
//     ],
//     AddressNumber: "STRING_VALUE",
//     Building: "STRING_VALUE",
//   },
//   AddressNumberCorrected: true || false,
//   PostalCodeDetails: [ // PostalCodeDetailsList
//     { // PostalCodeDetails
//       PostalCode: "STRING_VALUE",
//       PostalAuthority: "STRING_VALUE",
//       PostalCodeType: "STRING_VALUE",
//       UspsZip: { // UspsZip
//         ZipClassificationCode: "STRING_VALUE",
//       },
//       UspsZipPlus4: { // UspsZipPlus4
//         RecordTypeCode: "STRING_VALUE",
//       },
//     },
//   ],
//   Position: [ // Position
//     Number("double"),
//   ],
//   MapView: [ // BoundingBox
//     Number("double"),
//   ],
//   Categories: [ // CategoryList
//     { // Category
//       Id: "STRING_VALUE", // required
//       Name: "STRING_VALUE", // required
//       LocalizedName: "STRING_VALUE",
//       Primary: true || false,
//     },
//   ],
//   FoodTypes: [ // FoodTypeList
//     { // FoodType
//       LocalizedName: "STRING_VALUE", // required
//       Id: "STRING_VALUE",
//       Primary: true || false,
//     },
//   ],
//   BusinessChains: [ // BusinessChainList
//     { // BusinessChain
//       Name: "STRING_VALUE",
//       Id: "STRING_VALUE",
//     },
//   ],
//   Contacts: { // Contacts
//     Phones: [ // ContactDetailsList
//       { // ContactDetails
//         Label: "STRING_VALUE",
//         Value: "STRING_VALUE",
//         Categories: [
//           {
//             Id: "STRING_VALUE", // required
//             Name: "STRING_VALUE", // required
//             LocalizedName: "STRING_VALUE",
//             Primary: true || false,
//           },
//         ],
//       },
//     ],
//     Faxes: [
//       {
//         Label: "STRING_VALUE",
//         Value: "STRING_VALUE",
//         Categories: [
//           {
//             Id: "STRING_VALUE", // required
//             Name: "STRING_VALUE", // required
//             LocalizedName: "STRING_VALUE",
//             Primary: true || false,
//           },
//         ],
//       },
//     ],
//     Websites: [
//       {
//         Label: "STRING_VALUE",
//         Value: "STRING_VALUE",
//         Categories: [
//           {
//             Id: "STRING_VALUE", // required
//             Name: "STRING_VALUE", // required
//             LocalizedName: "STRING_VALUE",
//             Primary: true || false,
//           },
//         ],
//       },
//     ],
//     Emails: [
//       {
//         Label: "STRING_VALUE",
//         Value: "STRING_VALUE",
//         Categories: [
//           {
//             Id: "STRING_VALUE", // required
//             Name: "STRING_VALUE", // required
//             LocalizedName: "STRING_VALUE",
//             Primary: true || false,
//           },
//         ],
//       },
//     ],
//   },
//   OpeningHours: [ // OpeningHoursList
//     { // OpeningHours
//       Display: [ // OpeningHoursDisplayList
//         "STRING_VALUE",
//       ],
//       OpenNow: true || false,
//       Components: [ // OpeningHoursComponentsList
//         { // OpeningHoursComponents
//           OpenTime: "STRING_VALUE",
//           OpenDuration: "STRING_VALUE",
//           Recurrence: "STRING_VALUE",
//         },
//       ],
//       Categories: "<CategoryList>",
//     },
//   ],
//   AccessPoints: [ // AccessPointList
//     { // AccessPoint
//       Position: [
//         Number("double"),
//       ],
//     },
//   ],
//   AccessRestrictions: [ // AccessRestrictionList
//     { // AccessRestriction
//       Restricted: true || false,
//       Categories: "<CategoryList>",
//     },
//   ],
//   TimeZone: { // TimeZone
//     Name: "STRING_VALUE", // required
//     Offset: "STRING_VALUE",
//     OffsetSeconds: Number("long"),
//   },
//   PoliticalView: "STRING_VALUE",
//   Phonemes: { // PhonemeDetails
//     Title: [ // PhonemeTranscriptionList
//       { // PhonemeTranscription
//         Value: "STRING_VALUE",
//         Language: "STRING_VALUE",
//         Preferred: true || false,
//       },
//     ],
//     Address: { // AddressComponentPhonemes
//       Country: [
//         {
//           Value: "STRING_VALUE",
//           Language: "STRING_VALUE",
//           Preferred: true || false,
//         },
//       ],
//       Region: [
//         {
//           Value: "STRING_VALUE",
//           Language: "STRING_VALUE",
//           Preferred: true || false,
//         },
//       ],
//       SubRegion: [
//         {
//           Value: "STRING_VALUE",
//           Language: "STRING_VALUE",
//           Preferred: true || false,
//         },
//       ],
//       Locality: [
//         {
//           Value: "STRING_VALUE",
//           Language: "STRING_VALUE",
//           Preferred: true || false,
//         },
//       ],
//       District: "<PhonemeTranscriptionList>",
//       SubDistrict: "<PhonemeTranscriptionList>",
//       Block: "<PhonemeTranscriptionList>",
//       SubBlock: "<PhonemeTranscriptionList>",
//       Street: "<PhonemeTranscriptionList>",
//     },
//   },
// };

GetPlaceCommand Input

See GetPlaceCommandInput for more details

Parameter
Type
Description
PlaceId
Required
string | undefined

The PlaceId of the place you wish to receive the information for.

AdditionalFeatures
GetPlaceAdditionalFeature[] | undefined

A list of optional additional parameters such as time zone that can be requested for each result.

IntendedUse
GetPlaceIntendedUse | undefined

Indicates if the results will be stored. Defaults to SingleUse, if left empty.

Key
string | undefined

Optional: The API key to be used for authorization. Either an API key or valid SigV4 signature must be provided when making a request.

Language
string | undefined

A list of BCP 47  compliant language codes for the results to be rendered in. If there is no data for the result in the requested language, data will be returned in the default language for the entry.

PoliticalView
string | undefined

The alpha-2 or alpha-3 character code for the political view of a country. The political view applies to the results of the request to represent unresolved territorial claims through the point of view of the specified country.

GetPlaceCommand Output

See GetPlaceCommandOutput for details

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
PlaceId
Required
string | undefined

The PlaceId of the place you wish to receive the information for.

PlaceType
Required
PlaceType | undefined

A PlaceType is a category that the result place must belong to.

PricingBucket
Required
string | undefined

The pricing bucket for which the query is charged at.

For more inforamtion on pricing, please visit Amazon Location Service Pricing .

Title
Required
string | undefined

The localized display name of this result item based on request parameter language.

AccessPoints
AccessPoint[] | undefined

Position of the access point in (lng,lat).

AccessRestrictions
AccessRestriction[] | undefined

Indicates known access restrictions on a vehicle access point. The index correlates to an access point and indicates if access through this point has some form of restriction.

Address
Address | undefined

The place's address.

AddressNumberCorrected
boolean | undefined

Boolean indicating if the address provided has been corrected.

BusinessChains
BusinessChain[] | undefined

The Business Chains associated with the place.

Categories
Category[] | undefined

Categories of results that results must belong to.

Contacts
Contacts | undefined

List of potential contact methods for the result/place.

FoodTypes
FoodType[] | undefined

List of food types offered by this result.

MapView
number[] | undefined

The bounding box enclosing the geometric shape (area or line) that an individual result covers.

The bounding box formed is defined as a set of four coordinates: [{westward lng}, {southern lat}, {eastward lng}, {northern lat}]

OpeningHours
OpeningHours[] | undefined

List of opening hours objects.

Phonemes
PhonemeDetails | undefined

How the various components of the result's address are pronounced in various languages.

PoliticalView
string | undefined

The alpha-2 or alpha-3 character code for the political view of a country. The political view applies to the results of the request to represent unresolved territorial claims through the point of view of the specified country.

Position
number[] | undefined

The position, in longitude and latitude.

PostalCodeDetails
PostalCodeDetails[] | undefined

Contains details about the postal code of the place/result.

TimeZone
TimeZone | undefined

The time zone in which the place is located.

Throws

Name
Fault
Details
AccessDeniedException
client

You don't have sufficient access to perform this action.

InternalServerException
server

The request processing has failed because of an unknown error, exception or failure.

ThrottlingException
client

The request was denied due to request throttling.

ValidationException
client

The input fails to satisfy the constraints specified by an AWS service.

GeoPlacesServiceException
Base exception class for all service exceptions from GeoPlaces service.