import math
scale=iface.mapCanvas().scale()
dpi=iface.mainWindow().physicalDpiX()
maxScalePerPixel = 156543.04
inchesPerMeter = 39.37
zoomlevel = int(round(math.log( ((dpi* inchesPerMeter * maxScalePerPixel) / scale), 2 ), 0))
print zoomlevel
https://gis.stackexchange.com/questions/268890/get-current-zoom-level-from-qgis-map-canvas