Categories: Software Quality

API – How to Get Started with Facebook API Integration

This article represents steps to get started with Facebook Graph API. In later articles, I shall explain how to integrate using Java and maybe other programming languages. The primary reason I am hooked to Facebook integration these days is my need for getting exploratory data from facebook for data analysis for my Big Data projects. Before getting onto use framework such as RestFB, it is recommended to play with these APIs in the Facebook-provided playground.  I shall be talking in detail about how to get started with RestFB in later articles. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos.

 

Following are the key points described later in this article:
  • How to explore different Facebook Graph APIs?
  • How to play with a particular Graph Explorer Page?

 

How to explore different Facebook Graph APIs

Facebook Graph API reference could be accessed on following page: https://developers.facebook.com/docs/graph-api/reference/v2.2. There are different APIs listed on this page. Some of key ones that I use most are following:

  • user
  • page
  • post
  • group
  • friendlist

Each of the above API is associated with a link that takes one to the detailed page consisting of information about that API. You could then goto Graph explorer page for that API which acts as a playground. Following image represents the same.


Clicking graph explorer takes one to the explorer page. In the image below, graph explorer for node type, page is displayed. The example illuatrates for page-id = cocacola.

 

How to play with a particular Graph Explorer Page?

Following represents instructions on how to get started with exploring specific Graph API:

  • In order to get started with Facebook Graph API development, the first and foremost important thing is to play with different Facebook Graph API and see the results.
  • To get started with Facebook graph API, you need to create an account with Facebook.com
  • Once create the account, login and try accessing the developers portal of facebook, https://developers.facebook.com/.
  • Then, once on developers page, click on Tools > Graph API Explorer.
  • This would take you to default Graph API explorer page. Following is the screenshot:
  • Following are key components of the above displayed page:
    • “me” represents node.
    • Each node may have one or more fields (attributes). “id”, “name” represents fields.
    • Clicking on “Search for a field” will display a list from which an item/field could be selected. Look at the picture below.
    • Once one or more fields get selected, the result would include the details for those fields and the same would be reflected in the query. Below diagram represents the “context” fields selection and the resultant query output.

 

Ajitesh Kumar

I have been recently working in the area of Data analytics including Data Science and Machine Learning / Deep Learning. I am also passionate about different technologies including programming languages such as Java/JEE, Javascript, Python, R, Julia, etc, and technologies such as Blockchain, mobile computing, cloud-native technologies, application security, cloud computing platforms, big data, etc. For latest updates and blogs, follow us on Twitter. I would love to connect with you on Linkedin. Check out my latest book titled as First Principles Thinking: Building winning products using first principles thinking. Check out my other blog, Revive-n-Thrive.com

Recent Posts

Autoencoder vs Variational Autoencoder (VAE): Differences

Last updated: 09th May, 2024 In the world of generative AI models, autoencoders (AE) and…

1 day ago

Linear Regression T-test: Formula, Example

Last updated: 7th May, 2024 Linear regression is a popular statistical method used to model…

4 days ago

Feature Engineering in Machine Learning: Python Examples

Last updated: 3rd May, 2024 Have you ever wondered why some machine learning models perform…

1 week ago

Feature Selection vs Feature Extraction: Machine Learning

Last updated: 2nd May, 2024 The success of machine learning models often depends on the…

1 week ago

Model Selection by Evaluating Bias & Variance: Example

When working on a machine learning project, one of the key challenges faced by data…

1 week ago

Bias-Variance Trade-off in Machine Learning: Examples

Last updated: 1st May, 2024 The bias-variance trade-off is a fundamental concept in machine learning…

1 week ago