Is their a library that can decode and encode directions google maps?

e.g
https://maps.googleapis.com/maps/api/directions/json?origin=Toronto&destination=Montreal&key=AIzaSyBWW28rR9NMj8vdsXNDRQYnUcpzlFmRvdQ