Oil shale contains a large amount of nitrogen compounds during pyrolysis, which will lead to a decline in the quality of shale oil and produce a large number of PM2.5 precursors. To study the migration and transformation of N during the pyrolysis, fixed-bed pyrolysis experiments were conducted on oil shale with different pyrolysis temperatures (500 ℃、600 ℃、700 ℃、800 ℃) and residence times (20 min、40 min), meanwhile, the migration and transformation of single AAEMs on the N of oil shale pyrolysis, the acid-wash samples were loaded with the original and higher concentrations of metals (K2CO3, CaCO3, Na2CO3, MgCO3) according to the ICP results and subjected to experiments at 600 °C - 20 min, the obtained products were analyzed by XPS、GC-MS and solution absorption method. The results revealed that higher temperatures promoted the enrichment of nitrogen-containing molecules in tar, and longer residence durations also led to an increase. Some mineral components in oil shale facilitated the conversion of semi-coke nitrogen to oil-phase nitrogen. An elevated loading concentration caused the catalytic cleavage of macromolecular nitrides. With an increase in temperature, NH3 and HCN exhibited two distinct peaks, respectively. AAEMs encouraged the production of NH3 but limited the content of HCN, where Ca played a more important function than K. The N transformation route was identified by contrasting the effects of reaction temperatures、residence times and AAEMs on N distribution.