They had API access but extracting and using the data in the way they did was against the terms of use IIRC
Back in the mid-'00s, we started implementing something against FB's API and I was more than a bit shocked to discover that their solution for preventing someone from building a parallel network of friend relationships out of the available dataset was "Please don't do that, and anyway if you try to do it at scale we'll probably detect the bandwidth consumption and shut you down." Not great.