Bounding Box Calculator
Calculate a geographic bounding box from a center point and radius
/v1/geo/bounding-box
curl -X POST "https://geo.toolkitapi.io/v1/geo/bounding-box" \
-H "Content-Type: application/json" \
-d '{
"center": {"lat": 51.5074, "lon": -0.1278},
"radius": 10,
"unit": "km"
}'
import httpx
resp = httpx.post(
"https://geo.toolkitapi.io/v1/geo/bounding-box",
json={
"center": {"lat": 51.5074, "lon": -0.1278},
"radius": 10,
"unit": "km"
},
)
print(resp.json())
const resp = await fetch("https://geo.toolkitapi.io/v1/geo/bounding-box", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
"center": {"lat": 51.5074, "lon": -0.1278},
"radius": 10,
"unit": "km"
}),
});
const data = await resp.json();
console.log(data);
# See curl example
{
"min_lat": 51.417522,
"max_lat": 51.597278,
"min_lon": -0.270384,
"max_lon": 0.014784,
"center": {"lat": 51.5074, "lon": -0.1278},
"radius": 10,
"unit": "km"
}
Try It Live
Description
How to Use
1. Provide the center point as a `center` object with `lat` and `lon` fields.
2. Set the `radius` value and optionally specify the `unit` (`km` or `mi`, default: `km`).
3. Send a POST request and use `min_lat`, `max_lat`, `min_lon`, `max_lon` in your spatial query.
About This Tool
Use the Bounding Box Calculator to compute the minimum and maximum latitude/longitude coordinates that form a rectangle enclosing a circular area around a center point. This is a common operation for spatial database queries where you need to find all records within a certain radius.
By pre-filtering with a bounding box, you can dramatically reduce the number of candidates before applying a more expensive exact-distance calculation.
Why Use This Tool
- Spatial queries — Pre-filter database records before applying exact distance calculations
- Map viewport — Calculate visible bounds for a given center and zoom level
- Geofencing — Define rectangular boundaries for location-based alerts
- Nearby search — Find points of interest within a radius efficiently
Frequently Asked Questions
How does this handle the poles?
What is the maximum radius?
Can I use this with SQL spatial queries?
Start using Bounding Box Calculator now
Get your free API key and make your first request in under a minute.