Skip to content

get_place

get_place(
    index_name: ResourceName,
    place_id: PlaceId,
    *,
    config_overrides: Optional[LocationClientConfig] = None,
    language: Optional[LanguageTag] = None,
    key: Optional[ApiKey] = None,
) -> GetPlaceResponse

This operation is no longer current and may be deprecated in the future. We recommend you upgrade to the V2 GetPlace operation unless you require Grab data.

  • This version of GetPlace is part of a previous Amazon Location Service Places API (version 1) which has been superseded by a more intuitive, powerful, and complete API (version 2).

  • Version 2 of the GetPlace operation interoperates with the rest of the Places V2 API, while this version does not.

  • If you are using an Amazon Web Services SDK or the Amazon Web Services CLI, note that the Places API version 2 is found under geo-places or geo_places, not under location.

  • Since Grab is not yet fully supported in Places API version 2, we recommend you continue using API version 1 when using Grab.

  • Start your version 2 API journey with the Places V2 API Reference or the Developer Guide.

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

A PlaceId is valid only if all of the following are the same in the original search request and the call to GetPlace.

  • Customer Amazon Web Services account

  • Amazon Web Services Region

  • Data provider specified in the place index resource

If your Place index resource is configured with Grab as your geolocation provider and Storage as Intended use, the GetPlace operation is unavailable. For more information, see AWS service terms.

Parameters:

  • index_name (ResourceName) –

    The name of the place index resource that you want to use for the search.

  • place_id (PlaceId) –

    The identifier of the place to find.

  • language (Optional[LanguageTag], default: None ) –

    The preferred language used to return results. The value must be a valid BCP 47 language tag, for example, en for English.

    This setting affects the languages used in the results, but not the results themselves. If no language is specified, or not supported for a particular result, the partner automatically chooses a language for the result.

    For an example, we'll use the Greek language. You search for a location around Athens, Greece, with the language parameter set to en. The city in the results will most likely be returned as Athens.

    If you set the language parameter to el, for Greek, then the city in the results will more likely be returned as Αθήνα.

    If the data provider does not have a value for Greek, the result will be in a language that the provider does support.

  • key (Optional[ApiKey], default: None ) –

    The optional API key to authorize the request.

Raises:

  • AccessDeniedException –

    The request was denied because of insufficient access or permissions. Check with an administrator to verify your permissions.

  • InternalServerException –

    The request has failed to process because of an unknown server error, exception, or failure.

  • ResourceNotFoundException –

    The resource that you've entered was not found in your AWS account.

  • ThrottlingException –

    The request was denied because of request throttling.

  • ValidationException –

    The input failed to meet the constraints specified by the AWS service.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_location/_services/location.py
def get_place(
    self,
    index_name: "capo_location.types.resource_name.ResourceName",
    place_id: "capo_location.types.place_id.PlaceId",
    *,
    config_overrides: Optional[LocationClientConfig] = None,
    language: Optional["capo_location.types.language_tag.LanguageTag"] = None,
    key: Optional["capo_location.types.api_key.ApiKey"] = None,
) -> "capo_location.types.get_place_response.GetPlaceResponse":
    """<important> <p>This operation is no longer current and may be deprecated in the future. We recommend you upgrade to the <a href="/location/latest/APIReference/API_geoplaces_GetPlace.html">V2 <code>GetPlace</code> </a> operation unless you require Grab data.</p> <ul> <li> <p>This version of <code>GetPlace</code> is part of a previous Amazon Location Service Places API (version 1) which has been superseded by a more intuitive, powerful, and complete API (version 2).</p> </li> <li> <p>Version 2 of the <code>GetPlace</code> operation interoperates with the rest of the Places V2 API, while this version does not.</p> </li> <li> <p>If you are using an Amazon Web Services SDK or the Amazon Web Services CLI, note that the Places API version 2 is found under <code>geo-places</code> or <code>geo_places</code>, not under <code>location</code>.</p> </li> <li> <p>Since Grab is not yet fully supported in Places API version 2, we recommend you continue using API version 1 when using Grab.</p> </li> <li> <p>Start your version 2 API journey with the Places V2 <a href="/location/latest/APIReference/API_Operations_Amazon_Location_Service_Places_V2.html">API Reference</a> or the <a href="/location/latest/developerguide/places.html">Developer Guide</a>.</p> </li> </ul> </important> <p>Finds a place by its unique ID. A <code>PlaceId</code> is returned by other search operations.</p> <note> <p>A PlaceId is valid only if all of the following are the same in the original search request and the call to <code>GetPlace</code>.</p> <ul> <li> <p>Customer Amazon Web Services account</p> </li> <li> <p>Amazon Web Services Region</p> </li> <li> <p>Data provider specified in the place index resource</p> </li> </ul> </note> <note> <p>If your Place index resource is configured with Grab as your geolocation provider and Storage as Intended use, the GetPlace operation is unavailable. For more information, see <a href="http://aws.amazon.com/service-terms">AWS service terms</a>.</p> </note>

    Args:
        index_name: <p>The name of the place index resource that you want to use for the search.</p>
        place_id: <p>The identifier of the place to find.</p>
        language: <p>The preferred language used to return results. The value must be a valid <a href="https://tools.ietf.org/search/bcp47">BCP 47</a> language tag, for example, <code>en</code> for English.</p> <p>This setting affects the languages used in the results, but not the results themselves. If no language is specified, or not supported for a particular result, the partner automatically chooses a language for the result.</p> <p>For an example, we'll use the Greek language. You search for a location around Athens, Greece, with the <code>language</code> parameter set to <code>en</code>. The <code>city</code> in the results will most likely be returned as <code>Athens</code>.</p> <p>If you set the <code>language</code> parameter to <code>el</code>, for Greek, then the <code>city</code> in the results will more likely be returned as <code>Αθήνα</code>.</p> <p>If the data provider does not have a value for Greek, the result will be in a language that the provider does support.</p>
        key: <p>The optional <a href="https://docs.aws.amazon.com/location/previous/developerguide/using-apikeys.html">API key</a> to authorize the request.</p>

    Raises:
        capo_location.errors.access_denied_exception.AccessDeniedException: <p>The request was denied because of insufficient access or permissions. Check with an administrator to verify your permissions.</p>
        capo_location.errors.internal_server_exception.InternalServerException: <p>The request has failed to process because of an unknown server error, exception, or failure.</p>
        capo_location.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource that you've entered was not found in your AWS account.</p>
        capo_location.errors.throttling_exception.ThrottlingException: <p>The request was denied because of request throttling.</p>
        capo_location.errors.validation_exception.ValidationException: <p>The input failed to meet the constraints specified by the AWS service. </p>
        capo_location.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_location.types.get_place_request.GetPlaceRequest]",
    ) -> OperationResponse[
        "capo_location.types.get_place_response.GetPlaceResponse"
    ]:
        import capo_location._operations.location_service.get_place

        output, http_response = (
            capo_location._operations.location_service.get_place.get_place(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_location.types.get_place_request.GetPlaceRequest",
    ) -> dict[str, Any]:
        import capo_location.types.get_place_request

        return capo_location.types.get_place_request.redact_sensitive(input_)

    def _redact_output(
        output: "capo_location.types.get_place_response.GetPlaceResponse",
    ) -> dict[str, Any]:
        import capo_location.types.get_place_response

        return capo_location.types.get_place_response.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "GetPlace", redact_input=_redact_input, redact_output=_redact_output
        ),
    )
    input_: capo_location.types.get_place_request.GetPlaceRequest = {
        "index_name": index_name,
        "place_id": place_id,
    }
    if language is not None:
        input_["language"] = language
    if key is not None:
        input_["key"] = key

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output