The attacks were prompted by the death of a local teenager due to a drug overdose. His parents blame Nigerian students for giving him the drugs.
Five Nigerian students were attacked on Monday by crowds, while another was beaten by a mob inside a shopping mall.
Police say five people have been arrested over the attacks.
Ms Swaraj said she had spoken to Uttar Pradesh Chief Minister Yogi Adityanath, and he had assured her of a "fair and impartial investigation into this unfortunate incident".