The prophet swallowed by a large fish who later went to Nineveh was Jonah.
In the Book of Jonah, God commands Jonah, son of Amittai, to preach against Nineveh. Jonah initially flees by ship toward Tarshish, but a violent storm leads sailors to throw him overboard. A “great fish” swallows him, and Jonah remains inside it for three days and three nights before being released.
Jonah then obeys God and enters Nineveh, warning that the city will be overthrown in forty days. The people, including the king, repent, fast, and wear sackcloth, so God spares the city. Jonah is unhappy because he expected judgment, making the story as much about mercy as obedience.
A common mix-up is calling the creature a whale. The Hebrew text says “great fish,” without identifying a species. Nineveh was an ancient Assyrian city near modern Mosul, Iraq.