Studies on the diversity of Anastrepha species have been conducted mainly in agricultural orchards due to the economic importance of this insect group, consequently, research on fruit flies in undisturbed environments is scarce. Moreover, very few studies have investigated the diversity of fruit flies in urban areas, where fruit flies survive under native or exotic hosts. Thus, to understand the diversity of Anastrepha species in an environment with different anthropization degrees, surveys were carried out in four areas of the "Luiz de Queiroz" campus, in Piracicaba, São Paulo State (Brazil), using Multilure traps with putrescine and ammonium acetate for 12 months. The software R 3.6.3 was used to characterize the fruit fly community and the faunistic analysis was carried out using the ANAFAU program. The analysis of species richness and total abundance of fruit flies among the sites was carried out using the rarefaction method and adjustment to the generalized linear model (GLM) using the Poisson distribution, respectively. We collected 1,080 females and 14 species of Anastrepha in the four sampled sites. Anastrepha fraterculus and A. obliqua were the predominant species (behavioral patterns). Similar to agricultural sites, A. fraterculus and A. obliqua also show a predominant occurrence in urban environments.