(Some local codes don't permit the use of 3" boxes.) The heaviest fan that should be supported by an outlet box is 35 lbs.. If it weighs more, the building structure must support it. Whatever you do, make sure the junction box is supported well enough to hold at least 50 lbs. That's the weight of an average ceiling fan. Also, your mounting must be able to withstand vibration while the fan is running. Even a well-balanced fan creates some vibration when it runs. You'll use a special beam mount when mounting a fan to a beamed ceiling. Use one kind for a horizontal beam, another for a pitched beam (Fig. 3). You may need an extender to lower the fan to the proper level. Fan-mounting is particularly important because any failure to make things secure could allow your fan to fall from the ceiling.
get here