The only sure way to know what fertilizer is best for your legumes is to have the soil that they are growing in tested by a lab. A professional lab, either private or university owned, can provide recommendations determined by the existing nutrient levels.
Unless a soil test suggests otherwise, fertilizers containing nitrogen should not be applied to legumes. Nitrogen applied to legume crops will aid in competition by weeds and non-desirable plant species. Common beans are the exception and can benefit by light nitrogen applications.
Most legumes thrive in a soil with a pH between 6.5 and 7.5. Applications of lime may be needed to aid in legume production. Legumes can also be deficient in some micro-nutrients such as zinc, boron and sulfur. Only a soil test can provide recommendations on how much and what to apply.