How to get all faces based on a certain angle of their normals?
Use Vector.angle(Vector)

To get all normals that are within 89 degrees of the -z axis in local space (down = Vector((0, 0, -1)) use face.normal.angle(down) which calculates the angle between the face normal and the local vector pointing down.

import bpy
from math import radians
from mathutils import Vector
context = bpy.context
obj = context.object
me = obj.data
down = Vector((0, 0, -1)) #  -z axis.
test_angle = radians(89) 
# list all faces with normal less than 89 degrees to down
faces = [f for f in me.polygons 
        if f.normal.angle(down) &lt; test_angle]

print(faces)


Change the test_angle value to suit.