client.ResolveAddressAsync()
Resolve Address
Returns the complete address for an autocomplete suggestion, identified by its address ID.
This is the step of the autocomplete flow that costs a lookup. Fetching suggestions is free.
The API returns resolved addresses, including addresses outside the UK, in a UK format (up to 3 address lines) using UK nomenclature such as postcode and county.
An ID that matches no address returns 404.
Endpoint
GET /autocomplete/addresses/{address}/gbr
See the API reference for this endpoint.
Signature
Task<GbrResolveAddressResponse> ResolveAddressAsync(string address, ResolveAddressParams? query = null, CancellationToken cancellationToken = default)
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
address | string | yes | ID of address suggestion |
query | ResolveAddressParams | no | Query parameters. Fields under Query Parameters. |
cancellationToken | CancellationToken | no | Cancels the request. |
Query Parameters
Set these on the query argument. Each property is the name in PascalCase, such as PostTown for post_town; required fields are constructor arguments.
| Name | Type | Required | Description |
|---|---|---|---|
tags | string | no | Tags |
remove_organisation | string | no | Remove Organisation |
Response
GbrResolveAddressResponse. Fields are properties in PascalCase, such as response.Result; fields this SDK version does not know are kept in AdditionalProperties. See responses.
Errors
An HTTP error throws ApiException with the StatusCode, the API error Code and the raw Body. A success response whose body cannot be read throws UnserializableResponseException. Network failures and cancellation throw HttpClient's own HttpRequestException and OperationCanceledException. See error handling.
Example
using IdealPostcodes;
using var client = new IdealPostcodesClient("ak_test");
var response = await client.ResolveAddressAsync("paf_2670849");
var address = response.Result;
Console.WriteLine(address.Line1);
Console.WriteLine($"{address.PostTown}, {address.Postcode}");
Console.WriteLine($"UPRN {address.Uprn} from {address.Dataset}");