Hi!
I have created a Twitter List by the following lines:

import tweepy
    
# name of the list
    name = "tweepy_list"
    
    client = tweepy.Client(consumer_key=consumer_key, consumer_secret=consumer_secret, access_token=access_token, access_token_secret=access_token_secret)
    l = client.create_list(name)
    id_l = l[0]['id']

Where id_l is the list id.

I have added users to the list by:

client.add_list_member(id_l, user_id)

Now, I want to build a search query by this code and I want to include the list of users I previously created by:

    query = "{0} lang:es -is:retweet list:{1}:".format(topic, id_l)
    tweets = client.search_recent_tweets(query=query,
                                             tweet_fields = ["created_at", "text", "source"],
                                             user_fields = ["name", "username", "location", "verified", "description"],
                                             max_results = 10,
                                             expansions='author_id',
                                             user_auth=True
                                             )

But I am getting this error:

> BadRequest: 400 Bad Request
> There were errors processing your request: Reference to invalid operator 'list'. Operator is not available in current product or product packaging. Please refer to complete available operator list at https://developer.twitter.com/en/docs/twitter-api/enterprise/rules-and-filtering/operators-by-product

I have asked about this impasse to the Stack Overflow community,
https://stackoverflow.com/questions/73299028/twitter-query-including-a-list-id-with-tweepy-python.
They suggested it is probably a bug.
What is your opinion about this difficulty?

Thank you!

list: is only usable by Academic Access (could work with Elevated Access projects too now?) And the link the error message is wrong, it should be: Search Tweets - How to build a query | Docs | Twitter Developer Platform

Also,

there is an extra : at the end that’s not valid.

Thank you, you are right about the extra “:”. Sadly, the problem is something else. I have the Elevated access, but I suspect the access is behaving as Essential. Do you know if someone could help me with this?


Screen Shot 2022-08-12 at 22.41.45

Best,

2 Likes

I am having the same issue. I have an elevated project but I am receiving the “Operator is not available in current product or product packaging.” when adding “list:1234…” to my search query.

Same error as I was getting during essential project access.

Using this following the v2 search operator docs is not working currently.

2 Likes

+Bump I am running into the same issue

2 Likes