A Glimpse of My Facebook Network

Abigail Chen
INST414: Data Science Techniques
3 min readFeb 25, 2022

As a result of the fake news scandal caused by the presidential election a few years ago and the subsequent campaign of Delete Facebook Account, I ultimately deleted my Facebook account that I had used for ten years. However, I had to re-register last year for a new account that added only a certain close friend and family to facilitate contact with my older family members. Even though Facebook is still one of the most popular social media networks in the world with the largest age coverage, I still want to dig deeper to see if the age span and the geography of my friends remain global among the only about 20 friends I have.

To get this information, I first signed up for a Facebook developer account. Since I had an existing Facebook profile, I was able to grab the information efficiently and easily. I got my friends list and their age information as well as data about my friends and their connections to my other friends.

The nodes in my network represent my friends, and these edges represent our connections to each other. I chose not to include the names of my friends but these clusters are already a good representation of my social circle. After grabbing the needed data, I created a dataFrame where I can specify the node ID and the node type and finally use NetworkX’s categorical() method to apply a colormap. Since I only have 26 friends in my Facebook account when I scrap the data, there are only 77 nodes. Fortunately, the77 nodes are related to each other by 254 edges still exhibit to me a small global village among my social circle.

To make the graph more readable, I made the graph in Gephi to visualize centain nodes. The green nodes indicate the region where they are located in China, while pink ones indicate other regions. Also, the larger the size of the nodes the greater the number of friends. Furthermore, the darker the color of the nodes represent we have more mutual friends. The well organized in the top right is my family in Maryland. Since they have a simple relationship and rarely use Facebook, the nodes of this group are very obvious. The disjointed group in the bottom right is mostly my friends at UMD, many of them are international students like me. For this reason, even though we have few mutual friends, we can see from the size of the nodes that they have a significant number of friends from different regions.

Finally, the biggest problem on the journey of completing this network diagram was finding appropriate data. In fact, before choosing Facebook, my priority was Instagram because I use it more often. Unfortunately, I could only find an API for capturing data from business accounts. Twitter’s complex architecture and long review time made me give up as well. Even though I finally chose Facebook, I was unable to read the data after generating tokens and re-capturing many times due to friend permission issues. Even though NetworkX was very helpful during the process of creating graphs, some of the syntax and index errors caused the graphs unable to be generated.

Due to the number of friends I have and my newness to API crawling, the data and filtering of data are very rough. After using NetworkX and Gephi, I also adopted the most traditional seaborn to view my circle of friends. This amazing change also taught me that learning a new skill can make a quantum leap in the visualization of data.

--

--