Methods
Method detail for: getGeoAttByAttribute
Global catch-all method that allows you to submit a set of parameters that will uniquely identify a geographic area, a set of parameters to be returned, and a dataset to be targetted. The API will make a best-guess attempt to determine which geographic area fulfills the criteria laid out and return the requested attributes for objects in the target dataset within that geographic area. Due to the flexibility of this method, very few parameters are required. However, if ambiguous details are given that do not uniquely identify a single geographic area, the API will simply use the first area that matches. (For example, to return all ZIP Codes in Adams County, Nebraska, you would need to specific both Adams as the target Counry and Nebraska as the target state. Specifying only Adams County (without a state) would cause the API to randomly choose one of the 12 counties called Adams in the US and then return the ZIP Codes within that Adams county, which may or may not be the one you wanted.)
Valid Datasets
Dataset | Dataset Details | Method Parameters |
---|---|---|
Counties | Click To View | Click To View |
Carrier Routes | Click To View | Click To View |
Maponics School Attendance Zone Boundaries | Click To View | Click To View |
When calling this dataset using this method, use these parameters:
(Note: Items marked with * are required) | ||
Maponics Public Schools | Click To View | Click To View |
ZIP Codes | Click To View | Click To View |
ZIP Code Centroids | Click To View | Click To View |
Sample Request and Return Data
<?xml version="1.0" encoding="UTF-8" ?>
<data>
<auth>
<loginname>your_username</loginname>
<key>your_api_key</key>
</auth>
<request>
<dataset>Z</dataset>
<method>getGeoAttByAttribute</method>
<returnType>xml</returnType>
<returnGeoType>wkt</returnGeoType>
<parameters>
<county>autauga</county>
<state>AL</state>
<fields>zip</fields>
</parameters>
</request>
</data>
{
"data":{
"auth":{
"loginname":"your_username",
"key":"your_api_key"
}
},
"request":[
{
"dataset":"Z",
"method":"getGeoAttByAttribute",
"returnType":"json",
"parameters":{
"id":"",
"name":"",
"zip":"",
"district_name":"",
"ed_level":"",
"city":"",
"county":"autauga",
"state":"AL",
"fields":"zip"
}
}
]
}
<?xml version="1.0" encoding="UTF-8" ?>
<data>
<resultcode>0</resultcode>
<message>Return OK</message>
<requestid>01-1436</requestid>
<request>
<item>
<zip>36051</zip>
</item>
<item>
<zip>36003</zip>
</item>
<item>
<zip>36006</zip>
</item>
<item>
<zip>36066</zip>
</item>
<item>
<zip>36067</zip>
</item>
<item>
<zip>36749</zip>
</item>
</request>
</data>
[
{
"resultcode":0,
"message":"Return OK",
"requestid":"01-1448"
},
[
{
"zip":"36051"
},
{
"zip":"36003"
},
{
"zip":"36006"
},
{
"zip":"36066"
},
{
"zip":"36067"
},
{
"zip":"36749"
}
]
]