What team gets the advantage of first bat in baseball?

Every inning, the visiting side bats first and bats in the top half of the inning. Baseball is more than just the excitement of hitting a home run or converting a double play.