Twitter Engagement

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

twitter_engagement(data, [api_key], [cloud])

Arguments

data – String | List – required – text to be analyzed
[api_key] – String – optional – your indico API key
[cloud] – String – optional – your private cloud subdomain

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

import indicoio
indicoio.config.api_key = 'YOUR_API_KEY'

# single example
indicoio.twitter_engagement("Don't forget to vote tomorrow! #democracy #tom4classpresident")

# batch example
indicoio.twitter_engagement([
    "Don't forget to vote tomorrow! #democracy #tom4classpresident",
    "Severe weather warning. We advise you stay home. #weather #tornado #storm"
])