Twitter NLP Services

Demographic Data Extraction

Extracts age, gender, relationship attributes of Twitter users for en, es, de, ru, fr, it languages. And for en language also politics, believer, education attributes.

Method and entrypoint

POST extract

Request Parameters
Name Description Requirement Type Value Example

lang

Language of Twitter user

required

Body

text

en

username

Username of Twitter user

required

Body

text

Jack

screenname

Screen name of Twitter user

required

Body

text

jack

description

Description of Twitter user

required

Body

text

Twitter, Square California

tweet

User’s tweets

required, multiple

Body

text

Hi! I am Jack

apikey

Authorizes to use the service

required

Query

String (40 chars)

YOUR_KEY

Responses

Request
curl -XPOST -H "Accept: application/xml"  -d "lang=en&username=Jack&screenname=jack&description=Twitter%2C+Square+California&tweet=Hi%21+I+am+Jack" "http://api.ispras.ru/twitter-nlp/1.0/extract?apikey=YOUR_KEY"
xml
<richUser>
  <user>
    <username>
      Jack
    </username>
    <screenname>
      jack
    </screenname>
    <description>
      Twitter, Square California
    </description>
    <tweetTexts>
      Hi! I am Jack
    </tweetTexts>
  </user>
  <ageAttribute>
    <over23>
      false
    </over23>
  </ageAttribute>
  <believerAttribute>
    <believer>
      true
    </believer>
  </believerAttribute>
  <educationAttribute>
    <education>
      PRIMARY
    </education>
  </educationAttribute>
  <genderAttribute>
    <gender>
      FEMALE
    </gender>
  </genderAttribute>
  <politicsAttribute>
    <politics>
      REPUBLICAN
    </politics>
  </politicsAttribute>
  <relationshipAttribute>
    <married>
      false
    </married>
  </relationshipAttribute>
</richUser>