Error 403 in search tweets

api

#1

I am using 30 day premium production end point and I have the following error
What is the problem?
python /usr/bin/search_tweets.py --max-results 100 --results-per-call 10 --filter-rule “xx (xxxx bar OR xxx-x bar OR y OR x OR s u OR uu) lang:en” --filename-prefix tesla --start-datetime 2018-03-30 --end-datetime 2018-04-28 --no-print-stream

ERROR:searchtweets.result_stream:HTTP Error code: 403: Forbidden: Authentication succeeded but account is not authorized to access this resource.
ERROR:searchtweets.result_stream:Rule payload: {‘query’: ‘xxxx bar OR xxx-x bar OR y OR x OR s u OR uu) lang:en’, ‘maxResults’: 10, ‘toDate’: ‘201804280000’, ‘fromDate’: ‘201803300000’}
Traceback (most recent call last):
File “/usr/bin/search_tweets.py”, line 193, in
main()
File “/usr/bin/search_tweets.py”, line 187, in main
for tweet in stream:
File “/usr/lib/python3.6/site-packages/searchtweets/utils.py”, line 140, in write_result_stream
yield from write_ndjson(_filename, stream)
File “/usr/lib/python3.6/site-packages/searchtweets/utils.py”, line 95, in write_ndjson
for item in data_iterable:
File “/usr/lib/python3.6/site-packages/searchtweets/result_stream.py”, line 202, in stream
self.execute_request()
File “/usr/lib/python3.6/site-packages/searchtweets/result_stream.py”, line 253, in execute_request
rule_payload=self.rule_payload)
File “/usr/lib/python3.6/site-packages/searchtweets/result_stream.py”, line 101, in retried_func
raise requests.exceptions.HTTPError
requests.exceptions.HTTPError


#2

Hi @worknehy
Is this what you are trying to query?

xx (xxxx bar OR xxx-x bar OR y OR x OR s u OR uu) lang:en

Here’s another way to run it to test access:

curl -X POST “https://api.twitter.com/1.1/tweets/search/30day/envnamehere.json” -H "Authorization: Bearer " -d ‘{“bucket”:“day”,“query”:“xx (xxxx bar OR xxx-x bar OR y OR x OR s u OR uu) lang:en”}’