I’m writing a PHP script to crawl the Facebook API and record all the User IDs.
For example:
- https://graph.facebook.com/4 (Mark Zuckerberg)
- https://graph.facebook.com/9 (not a valid User ID; represents another Facebook object type)
My first thought was to start from #4 and increment by 1 every time. The problem with this plan is that there’s hugs gaps in the user IDs. Sometimes the API will return false for every number in a series of 100,000. And this just wastes time and cycles for my script running through all these falses.
Does anyone know of a better way to determine every valid Facebook user ID?
This is in violation of Facebooks Terms of Service 3.2:
You should also read this guys post about how he got sued by Facebook for doing something very similar.
One of the reason there are gaps is that originally id’s were allocated in 100k groups per school. So you will see old Facebook accounts from the same old with similar looking ids. Also, Facebook doesn’t provide any other api’s or information about getting a list of all of their id’s.