Back to APIs
Mapbox
Build custom map styles, get turn-by-turn navigation, search for places, and process geospatial data at scale.
Base URL
https://api.mapbox.comcustom mapsnavigationsearchGL JSvector tiles
Endpoints
GET
/geocoding/v5/mapbox.places/{query}.jsonForward geocode a search query to coordinates.
const response = await fetch("https://api.mapbox.com/geocoding/v5/mapbox.places/Brooklyn.json?access_token=YOUR_API_KEY", {
method: "GET",
headers: {
"Content-Type": "application/json",
"X-API-Key": "YOUR_API_KEY"
}
});
const data = await response.json();
console.log(data);Response Preview
{
"type": "FeatureCollection",
"features": [{
"place_name": "Brooklyn, New York, United States",
"center": [-73.9442, 40.6782],
"geometry": { "type": "Point", "coordinates": [-73.9442, 40.6782] }
}]
}