Skip to content

Fetch twitter

social · 3rd party API · integration

Enriches a dataset containing tweets with information about their authors.

In addition to author information also adds the location the tweet was send from (if available), and indicates whether a tweet was retweeted or favourited at least once. See below for a detailed list of the enrichment columns.

API integration

To use this step you will need to create an app associated to your Twitter account, and obtain four items: the consumer_key, the consumer_secret, the token and the token_secret.

To do so you can follow the steps here, and then add them to a Graphext integration.

Example

This step doesn't have any configuration parameters. Hence simply:

fetch_twitter(ds.id) -> (
  ds.user_created_at,
  ds.user_description,
  ds.user_favourites_count,
  ds.user_followers_count,
  ds.user_following_count,
  ds.user_listed_count,
  ds.user_profile_image_url_https,
  ds.user_protected,
  ds.user_tweets_count,
  ds.user_profile_url,
  ds.user_verified,
  ds.user_location,
  ds.lat,
  ds.long,
  ds.retweeted,
  ds.favorited,
  ds.source
)

Usage

The following are the step's expected inputs and outputs and their specific types.

fetch_twitter(tweet_ids: category|number) -> (
    user_created_at: date,
    user_description: text,
    user_favourites_count: number,
    user_followers_count: number,
    user_following_count: number,
    user_listed_count: number,
    user_profile_image_url_https: url,
    user_protected: boolean,
    user_tweets_count: number,
    user_profile_url: url,
    user_verified: boolean,
    user_location: category,
    lat: number,
    long: number,
    retweeted: boolean,
    favorited: boolean,
    source: category
)

Inputs


tweet_ids: column:category|number

Twitter's unique identifier for each tweet.

Outputs


user_created_at: column:date

Time the user who tweeted this tweet was created.


user_description: column:text

Self-description of the user.


user_favourites_count: column:number

How many tweets the user has favorited.


user_followers_count: column:number

How many followers the user has.


user_following_count: column:number

How many users the user is following.


user_listed_count: column:number

How many times the user has been listed in public listings.


user_profile_image_url_https: column:url

User's picture.


user_protected: column:boolean

Whether this user has protected their tweets or not.


user_tweets_count: column:number

How many times this user has tweeted.


user_profile_url: column:url

User's profile url.


user_verified: column:boolean

Whether this user is verified or not.


user_location: column:category

Location extracted from the author profile.


lat: column:number

Latitude this tweet was tweeted from.


long: column:number

Longitude this tweet was tweeted from.


retweeted: column:boolean

Whether you have retweeted this tweet.


favorited: column:boolean

Whether you have favorited this tweet.


source: column:category

Where this tweet was tweeted from as a HTML string.