- Previous: LocationInfo.getNeighborhoodsInCity
- Up: LocationInfo Library
- Next: LocationInfo.getZipCodesInState
LocationInfo.getStates
Description
Retrieves all 50 states, along with the longitude and latitude of the center point of each state.
Function Parameters
| Parameter | Description | Required | Format |
|---|---|---|---|
| apikey | Your TruliaAPI key | Yes |
Sample Call
http://api.trulia.com/webservices.php?library=LocationInfo
&function=getStates&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>getStates</value>
</Parameter>
<Parameter>
<index>3</index>
<name>apikey</name>
<value>abc123</value>
</Parameter>
</request>
<response>
<LocationInfo>
<state>
<name>Alaska</name>
<stateCode>AK</stateCode>
<longitude>123.456</longitude>
<latitude>123.456</latitude>
</state>
<state>
<name>Alabama</name>
<stateCode>AL</stateCode>
<longitude>123.456</longitude>
<latitude>123.456</latitude>
</state>
...
</LocationInfo>
</response>
</TruliaWebServices>

Comments
Please sign in to post a comment.