title: A good example of using the Mapbox distance API
body: <p>I am trying to use Mapbox to calculate the duration between two locations however the examples <a href="https://www.mapbox.com/api-documentation/?language=JavaScript#distance" rel="nofollow">here</a> are incomplete (at least with my limited experience). I would like to connect to this API using server-side Java, however I can't even get a basic example working in javaScript, Python or simply in the address bar in my browser.</p>
  
  <p>I can get an example working in my browser using this url and substituting in my API key:</p>
  
  <pre><code>https://api.mapbox.com/geocoding/v5/mapbox.places/Chester.json?country=us&amp;access_token=pk.my-token-value
  </code></pre>
  
  <p>However I can't get a similar example working with the distance API. The best I can manage is something like this:</p>
  
  <pre><code>https://api.mapbox.com/distances/v1/driving/[13.41894,52.50055],[14.10293,52.50055]&amp;access_token=pk.my-token-value.
  </code></pre>
  
  <p>But I have no idea how to format my coordinates as I can't find a single example.</p>
  
  <p>Has anyone been able to get this working. Ideally in Java, but client-side JavaScript or a valid url would be a great start.</p>
  
  <p>I should also add that I can't get the JavaScript or Python ones working as they rely on external librarys that aren't referenced anywhere in the <a href="https://www.mapbox.com/api-documentation/?language=JavaScript#distance" rel="nofollow">documentation</a>!.</p>
  
  <p>Thanks in advance.</p>