How to identify one face of cube via Blender's Python API?
This script should find the bottom face of the cube, not taking into consideration the cubes rotation.

import bpy
import bmesh

cube = bpy.context.active_object

bm = bmesh.new()
bm.from_mesh(cube.data)

minZ = float('inf')
for face in bm.faces:
    if face.calc_center_bounds()[2] &lt; minZ:
        minZ = face.calc_center_bounds()[2]
        bottom_face = face

cube.data.polygons[bottom_face.index].select = True
print('The bottom face is '+str(bottom_face))


Thus, you will need to either apply rotation (Ctrl + A) to all cubes or use the global Z, like this

import bpy
import bmesh

cube = bpy.context.active_object

bm = bmesh.new()
bm.from_mesh(cube.data)

minZ = float('inf')
for face in bm.faces:
    Z = (cube.matrix_world * face.calc_center_bounds())[2] ## This line is different
    if Z &lt; minZ:
        minZ = Z
        bottom_face = face

cube.data.polygons[bottom_face.index].select = True
print(bottom_face)       


EDIT: Simpler code without using bmesh

import bpy

cube = bpy.context.active_object
mesh = cube.data

minZ = float('inf')
for face in mesh.polygons:
    Z = face.center[2]
    if Z &lt; minZ:
        minZ = Z
        bottom_face = face

bottom_face.select = True
print('The bottom face is '+str(bottom_face))


for global coordinates replace the line 

Z = face.center[2]


with 

Z = (cube.matrix_world * face.center)[2]