I have used both the Google and Bing Maps APIs. Without more details or requirements, I can only provide general information.
Google Directions API
Bing Route Calculation
Just from some quick research, I do not believe Open Street Map has a native directions API. For other Open Street Map solutions, look on their wiki ("YOURS" specifically may be of interest).
Google Directions API
For the Google Directions API, a sample request for directions between two German cities would look like : http://maps.googleapis.com/maps/api/directions/json?region=de&language=de&origin=Berlin&destination=Hamburg&sensor=false
Breaking down the parameters required:
- origin The starting location.
- destination The destination.
- sensor Is the request for a device that can sense location?
And the parameters for a German search (optional):
- region=de Give Google Maps an idea of where in the world to search by passing in the German top level domain code.
- language=de Tell Google Maps to return directions in German (See available languages)
Modify this template request as required.
edit
Bing Routing Example
Bing requires you to get an API key to work with any data.
A sample request for Bing for the routes between two german cities: http://dev.virtualearth.net/REST/v1/Routes?wayPoint.1=Berlin&waypoint.2=Hamburg&culture=de-DE&key=YOUR_KEY_HERE
Required Params:
- wayPoint.1 The starting location.
- wayPoint.2 The destination (Note how you can easily add more waypoints).
- key Insert your Bing Map API key here.
Optional Params:
- culture=de-DE The culture parameter gives Bing an idea of where to search and what to return.
Terms of Use
Per the Google and Bing Maps API terms of use, you must display an image that lets users know you are using the mapping service.