is there any way to find the spawn coordinates in a server?

Solution 1:

There are several ways you can find out the spawn location.

/kill yourself

I mean literally, type /kill in the chat to kill your character, and then check your coordinate when you respawn. If you, as the other posts are warning:

keep on respawning next to a bed

Destroy the bed and /kill yourself again to return to the world's spawn point, or:

keep on respawning somewhere else that is definitely not spawn

Sleep in a bed to reset your /spawnpoint and then destroy the bed and /kill again.

random points

Use a compass (see below) or /gamerule spawnRadius 0 first.

Default is /gamerule spawnRadius 5, 10, or 16.

Use a Compass

There's an item in the game that will always point to the world's global spawn point. You can use it to guide you back to the world's spawn point.

Check your level.dat

Download your save file from Realms and check the level.dat of the game using an NBT Editor. SpawnX, SpawnY and SpawnZ are the coordinates of the world spawn point.

Solution 2:

If you want the specific coordinates, don’t want to die (keep inventory may be off), and you are quite far: get a friend who is closer to spawn to use a compass and they can press F3 and see the cordantes.