General bypass assuming the use case for having km mark on highway is if it's associated with some interchange on it: Let's assume we don't have such ready for use easy web API. So we need to build our "reverse geocoder" from km mark on highway to it's lat/lon.
We always have from popular GIS API's (Google maps etc.) coordinates for Interchanges, and of course we can order them.
Key point: In order to drive between 2 adjacent Interchanges, any decent routing web service algorithm (Google maps directions etc.) will always direct you to drive on that highway. It's logical... (with param like "shortest route" in case live heavy traffic and it will try to redirect you).
What I suggest is:
Let the first Interchange of the highway to be 0 K.
Ask for directions to the second interchange -
You will get the distance - so you know what is the km mark for the second interchange.
And so on to cover the highway until the km point you need.