LocationInfo.getCountiesInState

Description

Retrieves all counties in a state along with the longitude and latitude of the center point of each county.

Function Parameters

Parameter Description Required Format
apikey Your TruliaAPI key Yes
state The state you wish to find counties in Yes 2-letter postal code

Sample Call

http://api.trulia.com/webservices.php?library=LocationInfo&function=
getCountiesInState&state=CA&apikey=abc123

Sample Return (Truncated for clarity)

<TruliaWebServices>
  <request>
    <Parameter>
      <index>1</index>
      <name>library</name>
      <value>LocationInfo</value>
    </Parameter>
    <Parameter>
      <index>2</index>
      <name>function</name>
      <value>getCountiesInState</value>
    </Parameter>
    <Parameter>
      <index>3</index>
      <name>state</name>
      <value>CA</value>
    </Parameter>
    <Parameter>
      <index>4</index>
      <name>apikey</name>
      <value>abc123</value>
    </Parameter>
  </request>
  <response>
    <LocationInfo>
      <state>CA</state>
      <county>
        <id>06001</id>
        <name>Alemeda</name>
        <longitude>123.456</longitude>
        <latitude>123.456</latitude>
      </county>
      <county>
        <id>06003</id>
        <name>Alpine</name>
        <longitude>123.456</longitude>
        <latitude>123.456</latitude>
      </county>
      ...       
    </LocationInfo>
  </response>
</TruliaWebServices>