Dinosaurs thrived for over 160 million years in Mesozoic ecosystems, displaying diverse ecological and evolutionary adaptations. Their ecology was shaped by large-scale climatic and biogeographic changes, calling for a ‘deep-time’ macroecological investigation. These factors include temperature fluctuations and the break up of Pangaea, influencing species richness, ecological diversity and biogeographic history. Recent improvements in the dinosaur fossil record have enabled large-scale studies of their responses to tectonic, geographic and climatic shifts. Trends in species diversity, body size and reproductive traits can now be analysed using quantitative approaches like phylogenetic comparative methods, machine learning and Bayesian inference. These patterns sometimes align with, but also deviate from, first-order macroecological rules (e.g. species–area relationship, latitudinal biodiversity gradient, Bergmann’s rule). Accurate reconstructions of palaeobiodiversity and niche partitioning require ongoing taxonomic revisions and detailed anatomical descriptions. Interdisciplinary research combining sedimentology, geochemistry and palaeoclimatology helps uncover the environmental conditions driving dinosaur adaptations. Fieldwork in under-sampled regions, particularly at latitudinal extremes, is crucial for understanding the spatial heterogeneity of dinosaur ecosystems across the planet. Open science initiatives and online databases play a key role in advancing this field, enriching our understanding of deep-time ecological processes, and offering new insights into dinosaur macroecology and its broader implications.