Skip to content
This repository has been archived by the owner on Mar 30, 2023. It is now read-only.

User attributes

Francesco Poldi edited this page Mar 3, 2020 · 5 revisions

Attributes

Here we can see the list of every attribute of the user object, we can access attributes via dot notation User.id.

These attributes can be used to format the output (config.Format) and to customize the fields to save in the files (config.Custom["users"]):

- {id}
- {name}
- {username}
- {bio}
- {location}
- {url}
- {join_date}
- {join_time}
- {tweets}
- {following}
- {followers}
- {likes}
- {media}
- {private}
- {verified}
- {avatar}
- {background_image}

Formatting and Customizing

user objects are scraped when one of these functions is used:

  • twint.run.Lookup
  • twint.run.Followers
  • twint.run.Following

Examples

Formatting

import twint

c = twint.Config()
c.Username = "username"
c.Format = "ID {id} | Username {username}"

twint.run.Lookup(c)

Customizing

import twint

c = twint.Config()
c.Username = "username"
c.Custom["user"] = ["id", "username"]
c.Output = "username.csv"
c.Store_csv = True

twint.run.Lookup(c)