This lecture explores the nitrogen (N) and phosphorus (P) metabolism in megacities, focusing on the case study of Beijing. It covers the inputs of N and P in agriculture, their flow within the urban system, and the downstream effects on water quality and eutrophication. The discussion includes the pathways of P through food consumption, waste disposal, and wastewater treatment, highlighting the challenges of nutrient recycling and the environmental impact of urban nutrient cycles.