Twitter Content Sentiment Ratio Barometer API

API Endpoint Specifications

  • Endpoint Path: /api/1/sentiment
  • Type of Data: JSON & 20/minute
  • Data Source: Twitter
  • Request Limit: 500 request/month
  • Script & Integration: Code to integrate with cURL, JS, Python, Ruby, Php, Node.js, Java, .NET, Rust, Go, Typescript
Twitter Content Sentiment Ratio Barometer API Endpoint Basic Info

API Endpoint Path

required

Twitter Content Sentiment Ratio Calculator API

api/1/sentiment


Call Method

Required

POST

Type of Data Return

JSON

Output structured JSON data on Twitter trending content sentiment ratio


Available API Arguments & Parameters

token

required

BUYFROMLO API token. Paid subscription API is available: /api/1/sentiment, and accessible to on-site APP on /app/1/sentiment as well

keyword

required

Input a keyword query related to the trending content from Twitter


language

Optional

Input the language iso-id, such as en, ja, fr, etc. The default language is en


Twitter Content Sentiment Ratio Calculator API

api/1/sentiment


Code Integration and Response

Python Code Sample


import requests

apiendpoint = "https://api.buyfromlo.com/api/1/sentiment"

## Required Arguments & Parameters ##

token = ""your buyfromlo token""
keyword = ""Input a keyword""

data={"keyword": keyword}
headers={"Authorization": "Bearer " + token}

## Call the api ##
response = requests.post(apiendpoint, json=data, headers=headers)
print(response.status_code)
print(response.json())
                        

JSON Response Sample


{
    "Query": " " (string),
    "Subjectivity": " " (float),
    "Polarity": " " (float),
    "Positive": " " (float),
    "Negative": " " (float),
    "Neutral": " " (float)
}