Although it is recognized that certain environmental factors are important determinants of the expression of melanin-based traits, their influence in wild populations of animals is poorly known. One of these factors is the availability of amino acids that serve as precursors of melanins. Here we measured eumelanin and pheomelanin content in feathers of northern goshawk Accipiter gentilis nestlings, hypothesizing that, if the availability of melanin precursors is related to food abundance and habitat quality, plumage melanization should be affected by those variables. Although the eumelanin content increased with food abundance as predicted, the levels of this variable were higher in low-quality habitats (homogeneous coniferous forests) and in nestlings in poor condition, and the pheomelanin content and eumelanin:pheomelanin ratio were lower and higher, respectively, in subpopulations where nestlings were in poorer condition. Therefore, environmental availability of melanin precursors seems to determine plumage melanization in goshawks, but our findings may also be explained by the differential effects of environmental oxidative stress on both forms of melanin, as eumelanin and pheomelanin production are favoured under high and low levels, respectively, of oxidative stress.