twarc: Cannot find user_verified_type in the tweet metadata

The newly accessible field user_verified_type cannot be found in the tweet metadata that I fetched via twarc2.

image

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 18 (11 by maintainers)

Most upvoted comments

Should be all done now! v2.14.0 is the latest version and has the extra fields for v1.1 and v2

pip install --upgrade twarc

to update

Thank you! I just upgraded twarc. And yes, I can see verified_type now.

Should be all done now! v2.14.0 is the latest version and has the extra fields for v1.1 and v2

pip install --upgrade twarc

to update

AH! you’re right! My mistake - it was my messed up environments after all.

The latest 2.13.0 release indeed does not have that commit https://github.com/DocNow/twarc/blame/6d9b68f227ebadfe6e4b8d70bb951ea7cf78ba31/twarc/expansions.py#L43

@zhaomin1995 To fix this, the quickest way is to install directly from the latest main:

pip install --force https://github.com/DocNow/twarc/archive/main.zip

that should fix it! But we should release a new fix version on pypi - i don’t think i have access to do that so @edsu might have to release

Thanks for your response! I will wait for the latest release for this issue 😊

@igorbrigadir you are listed as a maintainer of twarc on pypi, so you should have permission to do this?

@igorbrigadir - looks like there hasn’t been a release since the field was added, I think that’s the issue.

What version of twarc do you have? It works in the latest one,

pip install --upgrade twarc

It worked for me:

twarc2 user name AmazonNews

Gives:

[
  {
    "data": [
      {
        "entities": {
          "url": {
            "urls": [
              {
                "start": 0,
                "end": 23,
                "url": "https://t.co/xOFqcYFp9O",
                "expanded_url": "http://www.amazon.com/about",
                "display_url": "amazon.com/about"
              }
            ]
          },
          "description": {
            "mentions": [
              {
                "start": 36,
                "end": 43,
                "username": "Amazon"
              }
            ]
          }
        },
        "profile_image_url": "https://pbs.twimg.com/profile_images/1250516096907571200/adjxWadZ_normal.jpg",
        "description": "The official account for news about @Amazon.",
        "name": "Amazon News",
        "username": "amazonnews",
        "id": "818902172347678720",
        "url": "https://t.co/xOFqcYFp9O",
        "protected": false,
        "location": "United States",
        "public_metrics": {
          "followers_count": 235481,
          "following_count": 887,
          "tweet_count": 10068,
          "listed_count": 955
        },
        "verified": true,
        "created_at": "2017-01-10T19:27:47.000Z",
        "verified_type": "business"
      }
    ],
    "__twarc": {
      "url": "https://api.twitter.com/2/users/by?tweet.fields=attachments%2Cauthor_id%2Ccontext_annotations%2Cconversation_id%2Ccreated_at%2Centities%2Cgeo%2Cid%2Cin_reply_to_user_id%2Clang%2Cpublic_metrics%2Ctext%2Cpossibly_sensitive%2Creferenced_tweets%2Creply_settings%2Csource%2Cwithheld%2Cedit_controls%2Cedit_history_tweet_ids&user.fields=created_at%2Cdescription%2Centities%2Cid%2Clocation%2Cname%2Cpinned_tweet_id%2Cprofile_image_url%2Cprotected%2Cpublic_metrics%2Curl%2Cusername%2Cverified%2Cverified_type%2Cwithheld&expansions=pinned_tweet_id&usernames=AmazonNews",
      "version": "2.13.0",
      "retrieved_at": "2023-03-29T16:53:52+00:00"
    }
  }
]

"verified_type": "business" is there