Lists unique values of an attribute table field and counts their number.
processing.runalg('qgis:listuniquevalues', input_layer, field_name, output)