# UPRN lookup

To get the address for a UPRN, call `addresses` with the `uprn:` filter and no query. The UPRN (Unique Property Reference Number) is the number UK local authorities assign to each property and Ordnance Survey maintains.

uprn\_lookup.rbruby

```ruby
require "ideal_postcodes"

client = IdealPostcodes::Client.new(api_key: "ak_test")
hits = client.addresses(uprn: 50002012147).result.hits

puts "#{hits.first.line_1}, #{hits.first.post_town}, #{hits.first.postcode}" if hits.any?
```

This prints `9 Malyons Road, Swanley, BR8 7RE`. The `query:` keyword is optional, so pass the `uprn:` filter alone.

## Several addresses per UPRN

Yes. A key with PAF Alias returns the Royal Mail record plus each alias for the same property. UPRN `1`, Bristol City Council, returns three hits: the `paf` record and two `pafa` aliases with different department lines. Check `dataset` on each hit if you want the Royal Mail record only.

## UPRN not found

`hits` is empty and the request costs nothing. It does not raise.

## One UPRN per request

One. The `uprn:` filter does not take a comma-separated list, so send one request per UPRN.

## Cost

One lookup when the UPRN matches an address. Your key needs one of PAF, Multiple Residence, Not Yet Built, PAF Alias, PAF Welsh, AddressBase or AddressBase Premium.

See [`search`](/docs/sdks/ruby/endpoints/addresses.md) for the other filters, such as `postcode_outward:` and `post_town:`.
