Exploring Twitter Api, Facebook Api, Cognitive services etc.
Hello Everyone, Today we are exploring twitter api , facebook api , cognitive services and many more and then in later blogs will show you benefits of all these analysis. So let’s start with twitter api, we are using postman for the same.Postman is a chrome app so first step to download chrome then add postman.

Twitter api with postman
Step 1. Login into your twitter account and open https://apps.twitter.com/ . click create new app button which opens application form detail page.

Enter details here and click on create your twitter application.After doing so your twitter app will be created. In my case my app name is Gaurav121, see below image

Step 2. Open postman, inside your Authorization tab select oAuth1.0 ,then copy your consumer key,cosumer secret ,token and token secret from your twitter app and paste here . enter your api url , set content type to application/x-www-form-urlencoded in header tab.
Url is https://api.twitter.com/1.1/search/tweets.json?q=%40narendramodi , this is for fetching all the latest tweets by Mr. Narendra modi. Now click on Send button and your response is

Now, you have a list of tweets by Mr. Narendra Modi.
Cognitive Services with Postman
Here we are exploring the text analytics api of cognitive services.From Official site of Cognitive services :
Microsoft Cognitive Services let you build apps with powerful algorithms using just a few lines of code. They work across devices and platforms such as iOS, Android, and Windows, keep improving, and are easy to set up.
Cognitive services icludes api like text analytics,emotion,face etc as shown below.

Login on cognitive services from https://www.microsoft.com/cognitive-services/en-us/apis and get a subscription key.
Open Postman and enter following details
Request URL : https://westus.api.cognitive.microsoft.com/text/analytics/v2.0/sentiment
Header Attribute :
Ocp-Apim-Subscription-Key: <your API key>
Content-Type: application/json
Accept: application/json
Request type : POST
Body :
{
“documents”: [
{
“language”: “en”, –> your language
“id”: “1”,
“text”: “I am Sad” –> Your Sentence
}
]
}

Now Press Send Button.
Output :

Here score is your main output.value varies between 0 to 1 and 1 is the perfect positive sentiment and 0 is perfect negative sentiment.
Facebook Api with Postman
For facebook , Use FaceBook Graph API.

























