Twitter Engagement

The Twitter Engagement API will be removed on April 15th, 2019.

POST https://apiv2.indico.io/twitterengagement

Private cloud endpoint

POST https://[cloud].indico.domains/twitterengagement/[batch]/

Arguments

data – String | List – required – text to be analyzed

Output

This function will return a number between 0 and 1. This number is a probability representing the confidence that the analyzed text will be retweeted or favorited. Values greater than 0.5 indicate high engagement content, while values less than 0.5 indicate low engagement content.

# single output
0.640490385821421

# batch output
[
    0.640490385821421,
    0.44804264881126155
]

Example

// Single Example
fetch('https://apiv2.indico.io/twitterengagement', {
  method: 'POST',
  body: JSON.stringify({
    api_key: 'YOUR_API_KEY',
    data: "Don't forget to vote tomorrow! #democracy #tom4classpresident"
  })
})
  .then(r => r.json())
  .then(response => {
    console.log(response);
  })
  .catch(err => console.log(err));

// Batch Example
fetch('https://apiv2.indico.io/twitterengagement/batch', {
  method: 'POST',
  body: JSON.stringify({
    api_key: 'YOUR_API_KEY',
    data: [
      "Don't forget to vote tomorrow! #democracy #tom4classpresident",
      "Severe weather warning. We advise you stay home. #weather #tornado #storm"
    ]
  })
})
  .then(r => r.json())
  .then(response => {
    console.log(response);
  })
  .catch(err => console.log(err));