The invention relates to a rare earth complex based on 2-HNCP and pyridine-3-carboxylic acid as mixed ligands, a preparation method, a crystal structure and an application of the rare earth complex. The molecular formula of the rare earth complex is [RE(2-NCP)2(3-pyc)]n. According to the preparation method, trivalent rare-earth salt, 2-HNCP and pyridine-3-carboxylic acid are mixed in the substance ratio being 1:(0.5-1.5):(0.5-1.5), a certain amount of water is added, the mixture is stirred for a period of time, pH of the mixture is regulated to be 5-8 with an NaOH solution, then the mixed solution is transferred to a reactor with a polytetrafluoroethylene liner, subjected to a reaction in a temperature range of 140-180 DEG C for a period of time and then cooled gradually to room temperature, a product is washed with water and aired at room temperature, and obtained bulk crystals are the rare earth complex. The rare earth complex is applied to aspects of catalysis of organic synthesis, selective adsorption and separation of CO2, CH4, H2, N2, O2 and other gas as well as selective adsorption, separation and photocatalytic degradation of organic dyes and phenolic endocrine disruptors. The synthetic method has the characteristics of high repeatability, high yield, stable product performance and the like.