Register
Please sign-in to register for this API. Your Pretype.com account is automatically enrolled in a 15 query free trial of this web service. Don't have an account? Register for a free pretype.com account.
Cost
Monthly fee of $5
Description
A collection of two distinct API calls related to zip code location information.
Lookup API
The lookup API translates a zip code into a city and state name, or translates a city/state combination into a set of zip codes.
Parameter: |
key |
Parameter Description: |
Your access key available from the account information page. |
Parameter: |
action |
Parameter Description: |
To use the lookup API, use an action of lookup. |
Parameter: |
zipcode |
Parameter Description: |
The zip code you want to translate into a city/state combination. Optional if both city and state are provided. |
Parameter: |
city |
Parameter Description: |
The city you want to translate into a zip code. If provided need to provide state as well. Optional if zip code provided. |
Parameter: |
state |
Parameter Description: |
The state you want to translate into a zip code. If provided need to provide city as well. Optional if zip code is provided. |
|
Example Request http://services.pretype.com/services/location/service.xml?key=[insert your key]&action=lookup&zipcode=12345
Example Response <response>
<status>SUCCESS</status>
<zipcode>12345</zipcode>
<city>Schenectady</city>
<state>New York</state>
</response>
|
|
|
Example Request http://services.pretype.com/services/location/service.xml?key=[insert your key]&action=lookup&city=renton&state=washington
Example Response <response>
<status>SUCCESS</status>
<location>
<zipcode>98055</zipcode>
<city>Renton</city>
<state>Washington</state>
</location>
<location>
<zipcode>98056</zipcode>
<city>Renton</city>
<state>Washington</state>
</location>
<location>
<zipcode>98057</zipcode>
<city>Renton</city>
<state>Washington</state>
</location>
<location>
<zipcode>98058</zipcode>
<city>Renton</city>
<state>Washington</state>
</location>
<location>
<zipcode>98059</zipcode>
<city>Renton</city>
<state>Washington</state>
</location>
</response>
|
|
Radius API
The radius API returns all zip codes within a certain distance of an input zip code. For example with an input zip code of 12345 and an input distance of 5, the output will be all zip codes within a 5 mile radius of 12345. The output results are ordered by closest to farthest. Please note this distance is approximate.
Parameter: |
key |
Parameter Description: |
Your access key available from the account information page. |
Parameter: |
action |
Parameter Description: |
To use the radius API, use an action of radius. |
Parameter: |
zipcode |
Parameter Description: |
The zip code you want to find other zip codes around. |
Parameter: |
distance |
Parameter Description: |
The distance around the input zip code you want to search. Must be greater than 0 and smaller than 300. |
|
Example Request http://services.pretype.com/services/location/service.xml?key=[insert your key]&action=radius&zipcode=98040&distance=4
Example Response <response>
<status>SUCCESS</status>
<location>
<zipcode>98118</zipcode>
<city>Seattle</city>
<state>Washington</state>
</location>
<location>
<zipcode>98004</zipcode>
<city>Bellevue</city>
<state>Washington</state>
</location>
<location>
<zipcode>98009</zipcode>
<city>Bellevue</city>
<state>Washington</state>
</location>
<location>
<zipcode>98015</zipcode>
<city>Bellevue</city>
<state>Washington</state>
</location>
<location>
<zipcode>98056</zipcode>
<city>Renton</city>
<state>Washington</state>
</location>
</response>
|
|