Hi,
I’m trying to get tweets related with grip ( means flu in turkish) I’m using pyton wrapper for this.I’ve build a query rule like this. But it’s returning “retrying request; current status code: 422” what am I doing wrong here? I have premium subscription so it’s not a sandbox environment. So I can use -has:links and -is:retweet operators cause I don’t want retweets and tweets with links . Here is my query rule;
rule = gen_rule_payload("grip lang:tr AND -has:links AND -is:retweet", results_per_call=500, from_date=2018-02-20, to_date=2018-02-21)
Also I’ve tried like this;
rule = gen_rule_payload("(grip) (lang:tr) -(has:links AND is:retweet)", results_per_call=500, from_date=2018-02-20, to_date=2018-02-21)
I’m sure that I’m missing something but what? Thanks for any help.
Best Regards.
Ok, I found that logical operator AND doesn’t work with premium search or I am doing it wrong. This rule is working and not giving error;
rule = gen_rule_payload("grip lang:tr -has:links -is:retweet", results_per_call=500, from_date=2018-02-20, to_date=2018-02-21)
It is filtering out retweets.But it doesn’t filtering out tweets with links. I wonder if we can negate has:links or not.
Also when I want to filter out replies this rule is giving error too;
rule = gen_rule_payload("grip lang:tr -has:links -is:retweet -is:reply", results_per_call=500, from_date=2018-02-20, to_date=2018-02-21)
Can’t we use is:reply in premium search? Is there anyway to filter out replies,retweets and tweets with links together?
By the way I’m using full archive search endpoint and I’m using GitHub - twitterdev/search-tweets-python: Python client for the Twitter 'search Tweets' and 'count Tweets' endpoints (v2/Labs/premium/enterprise). Now supports Twitter API v2 /recent and /all search endpoints.
Hamza
#3
Hi @AlpayKurbal - what’s the full error message you’re seeing when attempting to run this search request?
Hi,
It’s giving below error. Is there a way to get full error message that I don’t know? Because I’m just getting status code 422 which refers to Unprocessable Entity.
Grabbing bearer token from OAUTH
{“query”: “grip lang:tr -has:links -is:retweet -is:reply”, “fromDate”: “201802050000”, “toDate”: “201802060000”, “maxResults”: 500}
retrying request; current status code: 422
Best Regards
1 Like
Hamza
#5
Thanks for sharing the request. Can you try running the request with cURL? Here’s how to do so.
1 Like
Hi, thanks for helping out,
With curl request with
“query”:“grip lang:tr -has:links -is:retweet -is:reply”
I got following response;
{"error":{"message":"There were errors processing your request: Unrecognized operator:'is:reply'","sent":"2019-02-04T21:32:41+00:00","transactionId":"00c9fdc80019ca1f"}
So can’t I use “is:reply” operator with premium Full-Archive search API? Is there any alternative for same filtering?
Best Regards
Hamza
#8
I believe you are attempting to use this operator with the sandbox Search Premium Full-Archive API. is:reply is an operator that’s only available to use with the paid premium.