Obtain UPRNs for a Postcode
The following request demonstrates how to obtain the UPRNs that exist for a Postcode (e.g. SW1A 2AA).
GET /world/GB/spatial/addresses?postcode=SW1A%202AA HTTP/1.1
Host: api.whenfresh.com
Authorization: Bearer [YOUR_ACCESS_TOKEN]
Accept: application/ld+json
The response for the returned SpatialAddress resources will look like this:
HTTP/1.1 200 OK
Content-Type: application/ld+json
{
"@context": "https://api.whenfresh.com/.hydra/context.jsonld",
"@type": "hydra:Collection",
"manages": {
"property": "rdf:type",
"object": "SpatialAddress"
},
"member": [
{
"@id": "https://api.whenfresh.com/world/GB/spatial/addresses/100023336956",
"@type": "SpatialAddress",
"catalog": {
"@id": "https://api.whenfresh.com/world/GB/spatial/addresses/100023336956/catalog",
"@type": "Catalog"
},
"label": "PRIME MINISTER & FIRST LORD OF THE TREASURY, 10 DOWNING STREET",
"postalCode": "SW1A 2AA",
"uprn": 100023336956
}
],
"totalItems": 1
}
Next steps...
The catalog link for any spatial address can be used when Retrieving the Catalog for a Spatial Address or when Purchasing Variables from a Catalog.
