AbstractAimDetermine whether primary productivity or location (distance to the coast) is more important to migrating bird habitat selection.LocationYucatan Peninsula, Mexico.Time periodAugust–December and February–May 2009–2016.TaxaMigratory birds.MethodsUsing eBird data, we modelled spatial variation in species richness as a function of primary productivity and distance to the coast and how the relationships vary with time during spring and autumn migration. We compared the standardized regression coefficients of linear models with a Poisson error distribution.ResultsWe found that three primary productivity indices [normalized difference vegetation index (NDVI), enhanced vegetation index (EVI), heterogeneity] performed similarly in predicting species richness. However, species richness was more strongly associated with distance to the coast. In autumn, richness was higher closer to the coast through most of the season and then shifted inland late in autumn. Richness was also higher in more productive habitats. In spring, richness was higher inland early in the season but then increased closer to the coast. Species richness was relatively similar across the primary productivity gradient, even declining slightly with increasing NDVI.Main conclusionsWe did not find convincing evidence for a strong relationship between species richness and primary productivity. Instead, migration constrains birds such that they concentrate in coastal environments. In autumn, migrants may favour habitats that are both coastal and productive, such as those that occur along the Caribbean coast. In spring, migrants may also use the less productive Gulf of Mexico coast, possibly due to high arthropod production occurring during an otherwise dry time of year.