We investigated the roles of ecological and historical factors on the phylogenetic structure and spatial and trophic niches of anurans in Caatinga and Atlantic Forest in the Brazilian Northeast Region. We sampled specimens and ecological data using both active search and pitfall traps to sample sites for 15 days during dry and wet seasons. Assemblages from Caatinga were more structured on dietary niche than those from Atlantic Forest. Ecological factors had a higher effect on the trophic niche than on the spatial niche but were lower than historical factors, thus indicating past adaptations. The onset of the dry season usually increases the dietary structure of assemblages. Water restrictions in Caatinga affected prey abundance, increasing niche segregation. Differences between environments indicated that local factors exerted greater influence in Caatinga. We did not observe spatial niche structure in most assemblages, regardless of the environment, and we found strong evidence of niche conservatism in all assemblages. Phylogenetic effects detected in spatial niches reinforce the separation between arboreal and terrestrial/semi-aquatic lineages during the Cretaceous. Lastly, no niche complementarity was detected, despite the different structure patterns. No assemblage was phylogenetically structured, and the existence of a possible “ecological filter” in Caatinga did not lead to increased “phylogenetic clustering” in this environment.