client.resolve_place
Resolve Place
Returns the full place for a place ID taken from a /places suggestion.
On top of the fields carried by the suggestion, the response adds coordinates, language and the underlying dataset record.
Each request decrements your lookup balance. An unknown ID returns 404.
Endpoint
GET /places/{place}
See the API reference for this endpoint.
Signature
def resolve_place(place, tags: nil)
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
place | String | yes | ID of place suggestion |
keywords | keyword arguments | no | One per query parameter, named as the API names them. A keyword left out or nil is not sent. |
Query Parameters
Pass these as keyword arguments.
| Name | Type | Required | Description |
|---|---|---|---|
tags | String, Array<String> | no | Tags |
Response
IdealPostcodes::Responses::ResolvePlaceResponse. Read fields with readers named as the API names them, such as response.result, or with response["result"]. to_h returns the decoded body.
Errors
An HTTP error raises IdealPostcodes::ApiError with the HTTP status, the API error code and the decoded body. A transport failure raises IdealPostcodes::TransportError. See error handling.
Example
resolve-place.rbruby
require "ideal_postcodes"
client = IdealPostcodes::Client.new(api_key: "ak_test")
response = client.resolve_place("geonames_7296662")
place = response.result
puts "#{place.descriptive_name} (#{place.country_iso})"
puts "#{place.latitude}, #{place.longitude}"