How to request a grid section with what3words
Returns a section of the 3m x 3m what3words grid for a bounding box. The bounding box is specified by lat,lng,lat,lng as south,west,north,east. You can request the grid in GeoJSON format, making it very simple to display on a map.
curl --request GET
--url 'https://what3words.search.hereapi.com/v3/grid-section?key=MY-API-KEY&bounding-box=52.207988%2C0.116126%2C52.208867%2C0.117540&format=json'
Resource URL
https://what3words.search.hereapi.com/v3/grid-section
Parameters
| Parameter | Required/optional | Description | Example |
|---|---|---|---|
key | required | A valid API key; if not supplied as a parameter, a key must be supplied as a request header | key=[API-KEY] |
bounding-box | required | Bounding box, as a lat,lng,lat,lng, for which the grid should be returned. The requested box must not exceed 4km from corner to corner, or a BadBoundingBoxTooBig error will be returned. Latitudes must be >= -90 and <= 90, but longitudes are allowed to wrap around 180. To specify a bounding-box that crosses the anti-meridian, use longitude greater than 180. E.g.: bounding-box=50.0,179.995,50.01,180.0005 | bounding-box=52.207988,0.116126,52.208867,0.117540 |
format | optional | Return data format type; can be either json (the default) or geojson | format=geojson |
Example request
GET https://what3words.search.hereapi.com/v3/grid-section?bounding-box=52.207988,0.116126,52.208867,0.117540&format=json&key=[YOUR-API-KEY]
{
"lines": [
{
"start": {
"lng": 0.116126,
"lat": 52.208009918068136
},
"end": {
"lng": 0.11754,
"lat": 52.208009918068136
}
},
{
"start": {
"lng": 0.116126,
"lat": 52.20803686934023
},
"end": {
"lng": 0.11754,
"lat": 52.20803686934023
}
}
]
}
Updated last month