Method detail for: getGeoNearestByCoord

This request requires you to submit a latitude and longitude coordinate pair. The API will spatially determine the ZIP Code that those coordinates reside within and provide attribute data for the nearest ZIP+4 centroid within that ZIP Code to the supplied coordinate.

Valid Datasets

DatasetDataset DetailsMethod Parameters
Zip +4 PointsClick To ViewClick To View

When calling this dataset using this method, use these parameters:

  • lat*
  • lon*
  • (Note: Items marked with * are required)

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> <method>getGeoNearestByCoord</method> <parameters> <lat>40.713734</lat> <lon>-74.011683</lon> </parameters> </request> </data>
{ "data":{ "auth":{ "loginname":"your_username", "key":"your_api_key" }, "request":[ { "dataset":"", "method":"getGeoNearestByCoord", "count":"false", "context":"", "returnType":"json", "parameters":{ "lat":"40.713734", "lon":"-74.011683", "fields":"" } } ] } }
<?xml version="1.0" encoding="UTF-8" ?> <data> <resultcode>0</resultcode> <message>Return OK</message> <requestid>01-7077855</requestid> <request> <item> <geom>SRID=4326;POINT(-74.011554 40.713653)</geom> <placeid>3651000</placeid> <place>New York</place> <countyfips>36061</countyfips> <countyname>NEW YORK</countyname> <statefips>36</statefips> <state>NY</state> <zip>10007</zip> <z9>100072130</z9> <postalname>NEW YORK</postalname> </item> </request> </data>
[ { "resultcode":0, "message":"Return OK", "requestid":"01-10726", "request":[ [ { "geom":{ "type":"Point", "coordinates":[ -74.011554, 40.713653 ] }, "placeid":"3651000", "place":"New York", "countyfips":"36061", "countyname":"NEW YORK", "statefips":"36", "state":"NY", "zip":"10007", "z9":"100072130", "postalname":"NEW YORK" } ] ] } ]