The first two blasts Wednesday took place in the mostly Shia southeastern neighbourhood of New Baghdad, killing 20 people and injuring 56.
A car bomb targeting a police station exploded, while a suicide bomber blew himself up near a cinema.
The second double attack took place Wednesday evening in the eastern neighbourhood of al-Ghadir where two vehicles blew up near a popular market, killing 10 people and injuring 30, the security sources said.
The attacks coincided with the arrival of Kerry in Baghdad on an unannounced visit at the beginning of a regional tour which will include Jordan and Saudi Arabia and is designed to build support for Washington's campaign against the Islamic State (IS) Sunni extremist group in Iraq and Syria.
In the Saudi city of Jeddah, Kerry will meet Thursday with representatives of Saudi Arabia, Kuwait, the United Arab Emirates (UAE), Bahrain, Oman, Qatar, Jordan, Egypt and Turkey.
The coalition aimed at fighting the IS jihadis would be the "broadest possible" and would be designed to last for "months or even years", Kerry said before starting his trip.