Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Open Postcodes API Ruby Wrapper

Retrieve a list of addresses for any postcode in the United Kingdom using the Open Postcodes API.

Getting Started


gem install postcodes

Get an API Key

Get a key at Open Postcodes, then try out our service with our testing postcodes e.g. 'XA1 0XX'

Implement it

You can complete a full address lookup with just a couple of lines of Ruby.

require 'postcodes'

Postcodes.api_key = "your_key_here"

postcode = Postcodes::Postcode.lookup "XA1 0XX"

#	postcode.addresses =>
# [
#		{
#			:postcode=>"XA1 0XX",
# 		:post_town=>"LONDON",
# 		:line_1=>"The Pavilion",
# 		:line_2=>"Oaks Avenue",
# 		:line_3=>""
#		}, 
#		... and so on


Open Postcodes provides street level address data for website, mobile and desktop applications at a competitive price.

We charge 1p per public lookup; take a look at our pricing


More in-depth documentation can be found here

You can’t perform that action at this time.