You can collect Facebook data legally with the consent of the Facebook users and the consent of Facebook.
Nix, Alexander. Oral Evidence: Fake News. Digital, Culture, Media and Sport Committee, UK Parliament, 27 Feb. 2018.
Sourced by: Quote.org sourced