- Previous: LocationInfo.getStates
- Up: LocationInfo Library
- Next: TruliaStats Library
LocationInfo.getZipCodesInState
Description
Retrieves all ZIP codes in a state, as well as the longitude and latitude of the center point of each ZIP code.
Function Parameters
| Parameter | Description | Required | Format |
|---|---|---|---|
| apikey | Your API key | Yes | |
| state | The state you wish to find ZIP codes in. | Yes | 2-letter postal code |
Sample Call
http://api.trulia.com/webservices.php?library=LocationInfo&function=getZipCodesInState
&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>getZipCodesInState</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>
<zipCode>
<name>90001</name>
<longitude>123.456</longitude>
<latitude>123.456</latitude>
</zipCode>
<zipCode>
<name>90002</name>
<longitude>123.456</longitude>
<latitude>123.456</latitude>
</zipCode>
...
</LocationInfo>
</response>
</TruliaWebServices>
- Previous: LocationInfo.getStates
- Up: LocationInfo Library
- Next: TruliaStats Library

Comments
Please sign in to post a comment.