Table of contents
Google Curated Content
Download API definition:
This operation is a Technical Preview and is available for testing purposes only. Do not use in production.
GET https://dev-api.bentley.com/curated-content/google/geocode[?address][&components][&bounds][&language][&region][&extra_computations][&latlng][&result_type][&location_type]

Retrieves geocode information.

Request parameters

Name
Required?
Description
address
No
components
No
bounds
No
language
No
region
No
extra_computations
No
latlng
No
result_type
No
location_type
No

Request headers

Name
Required?
Description
Authorization
Yes

OAuth access token with itwin-platform scope

Accept
Yes

Setting to application/vnd.bentley.return-full-session-info+json is recommended.

Response 200 OK

OK

json
{
    "results": [{
        "address_components": [{
                "long_name": "1600",
                "short_name": "1600",
                "types": [
                    "street_number"
                ]
            },
            {
                "long_name": "Amphitheatre Parkway",
                "short_name": "Amphitheatre Pkwy",
                "types": [
                    "route"
                ]
            },
            {
                "long_name": "Mountain View",
                "short_name": "Mountain View",
                "types": [
                    "locality",
                    "political"
                ]
            },
            {
                "long_name": "Santa Clara County",
                "short_name": "Santa Clara County",
                "types": [
                    "administrative_area_level_2",
                    "political"
                ]
            },
            {
                "long_name": "California",
                "short_name": "CA",
                "types": [
                    "administrative_area_level_1",
                    "political"
                ]
            },
            {
                "long_name": "United States",
                "short_name": "US",
                "types": [
                    "country",
                    "political"
                ]
            },
            {
                "long_name": "94043",
                "short_name": "94043",
                "types": [
                    "postal_code"
                ]
            },
            {
                "long_name": "1351",
                "short_name": "1351",
                "types": [
                    "postal_code_suffix"
                ]
            }
        ],
        "formatted_address": "1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA",
        "geometry": {
            "location": {
                "lat": 37.4222804,
                "lng": -122.0843428
            },
            "location_type": "ROOFTOP",
            "viewport": {
                "northeast": {
                    "lat": 37.4237349802915,
                    "lng": -122.083183169709
                },
                "southwest": {
                    "lat": 37.4210370197085,
                    "lng": -122.085881130292
                }
            }
        },
        "place_id": "ChIJRxcAvRO7j4AR6hm6tys8yA8",
        "plus_code": {
            "compound_code": "CWC8+W7 Mountain View, CA",
            "global_code": "849VCWC8+W7"
        },
        "types": [
            "street_address"
        ]
    }],
    "status": "OK"
}

Response 400 Bad Request

The 400 (Bad Request) status code indicates that the request cannot be processed by the server due to a client error (e.g. malformed request syntax)

json
{
    "error": {
        "code": "InvalidGoogleCuratedContentRequest",
        "message": "Invalid request. Missing the 'address', 'components', 'latlng' or 'place_id' parameter."
    }
}

Response 401 Unauthorized

This response indicates that request lacks valid authentication credentials. Access token might not been provided, issued by the wrong issuer, does not have required scopes or request headers were malformed.

json
{
    "error": {
        "code": "HeaderNotFound",
        "message": "Header Authorization was not found in the request. Access denied."
    }
}

Response 429 Too many requests

This response indicates that the client sent more requests than allowed by this API for the current tier of the client.

json
{
    "error": {
        "code": "RateLimitExceeded",
        "message": "The client sent more requests than allowed by this API for the current tier of the client."
    }
}

Response headers

Name
Description
retry-after

Number of seconds to wait until client is allowed to make more requests.

GetGeocodeResponse

Name
Type
Description
results

An array of geocoded address information and geometry information.

GeocodeStatus

The status of the geocoding request.

Name
Type
Description
OK
String
ZERO_RESULTS
String
OVER_QUERY_LIMIT
String
REQUEST_DENIED
String
INVALID_REQUEST
String
UNKNOWN_ERROR
String

GeocodeResult

Error

Contains error information.

Name
Type
Description
code
String

One of a server-defined set of error codes.

message
String

A human-readable representation of the error.

target
String, null

The target of the error.

Error Response

Gives details for an error that occurred while handling the request. Note that clients MUST NOT assume that every failed request will produce an object of this schema, or that all of the properties in the response will be non-null, as the error may have prevented this response from being constructed.

Name
Type
Description
error

Error information.

Was this page helpful?