How to find continuation of a way?

There is a way like this one, not belonging to any relations and without a name.

How do I query for its natural continuation (say in the northern direction) over the next 2 kilometers?

As a bonus: Whenever there’s an ambiguity (like a crossroad or a fork), each of the continuations should be returned assuming they are of the same or higher road category.