Hi there, ive been struggling with this for a few days,

Im trying to connect to the full archive search premium APi via postman,

I have a sandbox dev environment set up:

The request is as follows

htps://api.twitter.com/1.1/tweets/search/fullarchive/firetweets.json?keyword=fire&fromdate=200902070059&todate=200902080059

(this url is misisng a t in https on purpose to post it as a non link)

And i have been using auth o.2 bearer token to authenticate

the reqeust returns the following error:

“error”: {
“message”: “Forbidden: Authentication succeeded but account is not authorized to access this resource.”,
“sent”: “2020-09-30T03:56:08+00:00”,
“transactionId”: “00fa667f001b8960”
}
}

Im not sure why i wouldnt be able to access this resource as i thought it was accsible (at a reduced level for sandbox users), and help would be greatly appreciated

I noticed you have FireTweet as the environment name and firetweets as the environment name in your request - these must match - if they do, make sure your bearer token for the application “Extreme Weather Aggregator” is good - you can try a request with Bearer auth to “/1.1/application/rate_limit_status.json” to check.

I’d also try using twurl GitHub - twitter/twurl: OAuth-enabled curl for the Twitter API instead of postman - postman is awkward to use and has a bunch of odd gotchas with authentication that makes it a nightmare to work with.

twurl will work for making arbitrary Premium calls to test, but i’d recommend using something like 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. to make queries once you’ve settled on a good query (also it’s good to use 30day endpoint to test queries because fullarchive is so limited - fire on it’s own is way too broad to give you good results i think - you’ll get way too many tweets.)

2 Likes

Hey there,
Thanks for such a swift reply, I also noticed the issue with non matching dev labes and fixed that after this post, Chaning this did not result in a succesful request.

However when you suggested that i run a /1.1/application/rate_limit_status.json” to check. it returned a 200 ok response - also showing this (which i think is the endpoint i wanted)
“/tweets/search/:product/:label”: {
“limit”: 1800,
“remaining”: 1798,
“reset”: 1601469983
So i belive my app is conected okay, so perhaps its an issue with the characters in my query field?

I just tried to send this request

https://api.twitter.com/1.1/tweets/search/fullarchive/Firetweets.json?query=%23bushfire&fromdate=200902070059&todate=200902080059

and got the following back

“error”: {
“message”: “There were errors processing your request: Unknown parameter:‘todate’, Unknown parameter:‘fromdate’”,
“sent”: “2020-10-06T01:43:05+00:00”,
“transactionId”: “007ab95d0004777d”
}
} suggesting my date format is wrong?

Thanks for this suggestions, im attempting to use Twitter apis for academic research and will need to get tweets from 2009 hence the fullarchive search. Im currently about 3 weeks away from starting my data collection on twitter so theres plenty of time to find the best method for sending qeuries, im just completely new to programming and my housemat suggested postman as an easy to look at interface, If python or the twurl applications are better should i just migrate to those?
cheers matt

im attempting to use Twitter apis for academic research

Don’t use postman - it’s a dev tool for debugging and you won’t get far with data collection making calls manually.

To make your queries, i’d recommend 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. as a command line tool to write out json you can import into whatever analysis you’ll be doing.

Another tool that works great out of the box is Twarc GitHub - DocNow/twarc: A command line tool (and Python library) for archiving Twitter JSON (i think this one may even be easier to use than the twitterdev tool)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.