Loading documentation...
Look up which U.S. county contains a given coordinate pair. Returns the county name, state, and FIPS codes.
https://api.landmapmagic.com/api/county/from-coordinates| Name | Type | Description |
|---|---|---|
| lat* | number | Latitude of the point to look up. |
| lng* | number | Longitude of the point to look up. |
| Attribute | Type | Description |
|---|---|---|
| county | string | County name (e.g. Story). |
| state | string | Full state name (e.g. Iowa). |
| county_fips | string | County FIPS code (e.g. 19169). |
| state_fips | string | State FIPS code (e.g. 19). |
curl -G "https://api.landmapmagic.com/api/county/from-coordinates" \
-H "Authorization: Bearer YOUR_API_KEY" \
--data-urlencode "lat=42.0308" \
--data-urlencode "lng=-93.6319"const params = new URLSearchParams({
lat: "42.0308",
lng: "-93.6319",
});
const response = await fetch(
`https://api.landmapmagic.com/api/county/from-coordinates?${params}`,
{
headers: {
Authorization: "Bearer YOUR_API_KEY",
},
}
);
const data = await response.json();
console.log(`${data.county}, ${data.state}`);import requests
response = requests.get(
"https://api.landmapmagic.com/api/county/from-coordinates",
headers={"Authorization": "Bearer YOUR_API_KEY"},
params={"lat": 42.0308, "lng": -93.6319},
)
data = response.json()
print(f"{data['county']}, {data['state']} (FIPS: {data['county_fips']})"){
"county": "Story",
"state": "Iowa",
"county_fips": "19169",
"state_fips": "19"
}