Trip generation modeling is essential in transportation planning activities. Previous modeling methods that depend on traditional data collection methods are inefficient and expensive. This paper proposed a novel data-driven trip generation modeling method for urban residents and non-local travelers utilizing location-based social network (LBSN) data and cellular phone data and conducted a case study in Nanjing, China. First, the point of interest (POI) data of the LBSN were classified into various categories by the service type, then, four features of each category including the number of users, number of POIs, number of check-ins, and number of photos were aggregated by traffic analysis zones to be used as explanatory variables for the trip generation models. We used a random tree regression method to select the most important features as the model inputs, and the trip models were established based on the ordinary least square model. Then, an exploratory approach was used to test the performance of each combination of the variables with various test methods to identify the best model for residents’ and travelers’ trip generation functions. The results suggest land use compositions have significant impact on trip generations, and the trip generation patterns are different between urban residents and non-local travelers.