I am wondering if there is a word in German that is meant to get attention, like from across the road or even the dining table, like hey or oi and what it would be.
The usual word for that is he (often with a lengthened e and then spelt hee, heee, heeeeee or similar):
He, kannst du mir sagen, wie spät es ist?
Heee, was machen Sie denn da?
There are also huhu and ey. Ey is often used when addressing someone who may be misbehaving, whereas huhu is normally reserved for positive contexts such as when helping a friend who is looking for you in a larger crowd:
Huhu, wir sind hier drüben!
Ey, was soll das? Das ist mein Fahrrad!
Apart from these interjections, there are, of course, many other phrases that can be used to get someone’s attention, such as greetings or various forms of “excuse me”:
Hallo! Haaallo! Guten Tag!
Entschuldigung!/’tschuldigung!/Entschuldigen Sie bitte!
They are usually considered more polite than in particular he.