I tried to use .GetTileData but it didn't work. And I haven't seen a way to get it thru .GetTile so I don't know how to get such info about the tile.
GetTileData is only used by the Tilemap itself; you never call this yourself. use this: https://docs.unity3d.com/2022.1/Documentation/ScriptReference/Tilemaps.Tilemap.GetSprite.html