Get Started
1curl -G https://api.housecanary.com/v2/property/value \
2 -d address=43+Valmonte+Plaza \
3 -d zipcode=90274 \
4 -u test_0TAQAK5ESOFQ1ZVLQO9M:rTecWozVb3dGkWkdUX7ElAgTFWqvWDHk \
1import pprint
2import requests
3
4url = 'https://api.housecanary.com/v2/property/value'
5params = {'address': '43 Valmonte Plaza', 'zipcode': '90274'}
6response = requests.get(url, params=params, auth=('test_0TAQAK5ESOFQ1ZVLQO9M', 'rTecWozVb3dGkWkdUX7ElAgTFWqvWDHk'))
7pprint.pprint(response.json())
1import java.net.*;
2
3import org.apache.commons.codec.binary.Base64;
4import org.apache.http.HttpEntity;
5import org.apache.http.HttpHeaders;
6import org.apache.http.client.methods.HttpGet;
7import org.apache.http.client.methods.CloseableHttpResponse;
8import org.apache.http.client.utils.URIBuilder;
9import org.apache.http.impl.client.HttpClients;
10import org.apache.http.impl.client.CloseableHttpClient;
11import org.apache.http.util.EntityUtils;
12
13/**
14* Example of making a GET request to the HouseCanary API
15* using the Apache HTTP library.
16*/
17public class HCApiGetExample {
18
19 public static void main(final String[] args) {
20 try {
21 String host = "api.housecanary.com";
22
23 // build up the URI with query params
24 URI uri = new URIBuilder()
25 .setScheme("https")
26 .setHost(host)
27 .setPath("/v2/property/value")
28 .setParameter("address", "43 Valmonte Plaza")
29 .setParameter("zipcode", "90274")
30 .build();
31
32 HttpGet httpGet = new HttpGet(uri);
33
34 String auth = "test_0TAQAK5ESOFQ1ZVLQO9M" + ":" + "rTecWozVb3dGkWkdUX7ElAgTFWqvWDHk";
35 byte[] encodedAuth = Base64.encodeBase64(auth.getBytes());
36 String authHeader = "Basic " + new String(encodedAuth);
37 httpGet.addHeader(HttpHeaders.AUTHORIZATION, authHeader);
38
39 CloseableHttpClient httpClient = HttpClients.createDefault();
40
41 CloseableHttpResponse response = httpClient.execute(httpGet);
42
43 try {
44 System.out.println(response.getStatusLine());
45
46 HttpEntity entity = response.getEntity();
47 System.out.println(EntityUtils.toString(entity));
48
49 EntityUtils.consume(entity);
50 } finally {
51 response.close();
52 }
53 return;
54
55 } catch (Exception e) {
56 e.printStackTrace();
57 }
58 }
59}
1namespace HouseCanaryAPIGist
2{
3 using System;
4 using System.Collections.Generic;
5 using System.Net;
6 using System.Net.Http;
7 using System.Net.Http.Headers;
8 using System.Text;
9
10 // Example of making a GET request to the HouseCanary API
11 // using System.Net.Http.HttpClient.
12 public class HCApiGetExample
13 {
14 public static void Main(string[] args)
15 {
16 using (var client = new HttpClient())
17 {
18 client.BaseAddress = new Uri("https://api.housecanary.com");
19
20 string queryParams;
21 using(var content = new FormUrlEncodedContent(new KeyValuePair[]{
22 new KeyValuePair("address", "43 Valmonte Plaza"),
23 new KeyValuePair("zipcode", "90274")
24 })) {
25 queryParams = content.ReadAsStringAsync().Result;
26 }
27
28 string url = "/v2/property/value?" + queryParams;
29
30 var byteArray = Encoding.ASCII.GetBytes("test_0TAQAK5ESOFQ1ZVLQO9M:rTecWozVb3dGkWkdUX7ElAgTFWqvWDHk");
31 client.DefaultRequestHeaders.Authorization =
32 new AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray));
33
34 HttpResponseMessage response = client.GetAsync(url).GetAwaiter().GetResult();
35
36 string body = response.Content.ReadAsStringAsync().GetAwaiter().GetResult();
37
38 Console.WriteLine(body);
39 }
40 }
41 }
42}
1require 'http'
2
3url = "https://api.housecanary.com/v2/property/value"
4
5query_params = {
6 "address": "43 Valmonte Plaza",
7 "zipcode": "90274"
8}
9
10response = HTTP.basic_auth(:user => "test_0TAQAK5ESOFQ1ZVLQO9M", :pass => "rTecWozVb3dGkWkdUX7ElAgTFWqvWDHk")
11.get(url, :params => query_params)
12
13puts response.to_s
1library(httr)
2
3url <- "https://api.housecanary.com/v2/property/value"
4
5query_params <- list(
6address = "43 Valmonte Plaza",
7zipcode = "90274"
8)
9
10r <- GET(
11url,
12authenticate("test_0TAQAK5ESOFQ1ZVLQO9M", "rTecWozVb3dGkWkdUX7ElAgTFWqvWDHk", type = "basic"),
13query = query_params)
14
15print(str(content(r)))
1// Example with Node.js
2
3const request = require('request');
4const url = 'https://api.housecanary.com/v2/property/value';
5
6request.get({
7 url: url,
8 auth: {
9 user: 'test_0TAQAK5ESOFQ1ZVLQO9M',
10 pass: 'rTecWozVb3dGkWkdUX7ElAgTFWqvWDHk'
11 },
12 qs: {
13 address: '43 Valmonte Plaza',
14 zipcode: '90274'
15 }
16}, function (error, response, body) {
17 console.log(body);
18});