This reference documents version 2 of the Placester RESTful API.

The code in this document requires an API key which you can obtain from the Placester plugin. Each call to the API returns a maximum of 50 listings. If you need more listings, refer to the offset argument below.

Basic Use

  http://api.placester.com/api/v2/listings/locations[agency_id][.format]?api_key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

cURL

curl -X GET -d "api_key=xxxxxxxxxxxxxx" http://api.placester.com/api/v2/listings/locations

PHP

$url = 'http://api.placester.com/v2/listings/locations?api_key=' . $my_api_key_here;

$curlcall = curl_init();
curl_setopt($curlcall, CURLOPT_URL, $url);
curl_setopt($curlcall, CURLOPT_HTTPGET, 1);

$curlout = curl_exec($curlcall);

[.format] can be .xml or .json depending on the format you want the API to output.

Arguments

Arguments are specified on the URL usually after the API key and are separated by an &. You can use the following patterns for different types of arguments:

FormatURL Argument
String, Integer, or Floatkey=StringValue
Arraykey[]=StringValue1&key[]=StringValue2&key[]=StringValue3…
Hashmetadata[key]=2&metadata[key]=4

 

ArgumentDescriptionExample
agency_idAgency ID to filter by (Optional)
include_disabled=BooleanWhether to include disabled listings in the results

 

Returns

KeyDescription
postal[]Array of all the postal/zip codes
region[]Array of all the regions/states
locality[]Array of all the cities
neighborhood[]Array of all the neighborhoods
county[]Array of all the counties

 

Sample Output

<?xml version="1.0" encoding="UTF-8"?>
<location>
    <postal>
        <postal>47905</postal>
        <postal>46750</postal>
        <postal>46614</postal>
        <postal>47920</postal>
    </postal>
    <region>
        <region>IN</region>
        <region>N</region>
        <region>OM</region>
        <region>MI</region>
    </region>
    <locality>
        <locality>Lafayette</locality>
        <locality>South Bend</locality>
        <locality>Kendallville</locality>
        <locality>Bloomington</locality>
    </locality>
    <neighborhood>
        <neighborhood></neighborhood>
        <neighborhood>Fair Oak</neighborhood>
        <neighborhood>None</neighborhood>
        <neighborhood>Pointe-Woodridge</neighborhood>
        <neighborhood>Abbott Acre</neighborhood>
        <neighborhood>Forest Park Heights</neighborhood>
    </neighborhood>
    <county>
        <county>Tippecanoe</county>
        <county>St. Joseph</county>
        <county>Noble</county>
        <county>Monroe</county>
    </county>
</location>