Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Ruby client for the Realestate.co.nz API
Ruby
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib use 'basic' format by default instead of 'full
test ensure that images work, add the option to create them from urls too
.gitignore
.travis.yml
Gemfile some wip
README.md
Rakefile
realestate-ruby.gemspec

README.md

Realestate.co.nz API Client for Ruby

Build Status

NB: This API Client is currently under active development, things may change rapidly :)

All methods return the parsed JSON from the API, so this is usually an array of hashes. For documentation on specific elements, see the PDF provided by Realestate.co.nz.

Creating a new client:

client = Realestate::Client.new(:public_key => YOUR_PUBLIC_KEY, :private_key => YOUR_PRIVATE_KEY)
#=> <Realestate::Client...>

Category methods (note that dashes in API paths are converted to underscores for Ruby method names):

client.suburbs
#=> [ { "id" => 3312, "name" => "Fiji" ... } ]

client.districts
#=> [ { "id" => 1, "name" => "Fiji" ... } ]

client.regions
#=> [ { "id" => 34, "name" => "Northland" ... } ]

client.listing_types
#=> [ { "id" => 1, "name" => "Residential" ... } ]

client.pricing_methods
#=> [ { "id" => 1, "name" => "Fixed Price" ... } ]

Listing searching, will concatenate pages automatically. Search paramters as per Realestate.co.nz documentation.

client.listings(:district_id => 1, :format => "id")
#=> [ { "id" : 1234, ... }]

The Realestate::Image class represents an image on the image server. You can create images via ID or URL:

image = Realestate::Image.new(12345)
# => <Realestate::Image... >

image = Realestate::Image.new("http://imageserver.realestate.co.nz/1234")
# => <Realestate::Image... >

You can download images using the download method, and the w/h/bg/mode parameters as per the documentation:

image = Realestate::Image.new(12345)
image.download(:w => 200, :h => 100)
# => <IO ... >
Something went wrong with that request. Please try again.