afaik there is no such API function to get that data without actually interacting with some player, or having at least the crosshair above the player.
Check some helper functions here:
https://github.com/esoui/esoui/blob/...yername.lua#L1
GetUnitDisplayName awaits as parameter a unittag which would be player, group1, group2, groupn, reticleover, boss1, boss2, bossn, etc.
If you are grouped you can use that one to get the displayname via the groupN tags, and check the group's charactername via GetUnitName(unitTag).
Maybe the functions will work too if you move the crosshair above the player you want to get the data from, and use it with
the unitTag "reticleover".
You can use an event to detect the change of a reticle target:
https://github.com/esoui/esoui/blob/...plete.lua#L146