How to hit the Mapbox API

Mapbox's APIs live at https://api.mapbox.com. The token goes in the query string as access_token. Coordinates are longitude first.

Authentication

Copy your default public token (starts pk.) from your Mapbox account. In the examples it's written {{MAPBOX_TOKEN}}.

Full reference: https://docs.mapbox.com/api/overview/

Geocode an address

Geocoding API v6.

curl "https://api.mapbox.com/search/geocode/v6/forward?q=1600+Pennsylvania+Ave+Washington+DC&limit=1&access_token={{MAPBOX_TOKEN}}"
Run in PostTaco

Driving directions

curl "https://api.mapbox.com/directions/v5/mapbox/driving/-122.42,37.78;-122.27,37.80?overview=false&access_token={{MAPBOX_TOKEN}}"
Run in PostTaco