How in the world do I use the Twitter API? Everything online seems outdated and doesn’t work. I created a twitter application on the developer portal and got my access tokens, etc. What do I do now? I’m trying to use JQuery to make an ajax get request. But what do I do the request on? Their documentation is complete trash.
Question posted in Twitter API
The official Twitter API documentation can be found here.
The official Twitter API documentation can be found here.
3
Answers
Please refer to the documentation
Where it suggests that you can use the url
to get recent tweets with the
superbowl
hashtag.Note that the
#
in that url has been encoded to%23
. You can find a reference for those encodings here.From the docs, these are the different search operations you can perform:
Since the new Twitter API requires authentication for all calls, even those not specific to a given account, it makes it very difficult to make calls to the API directly from Javascript.
However, you can use TweetJS.com which offers a Javascript wrapper on the Twitter API, that does not require authentication. A hashtag search would be as follows;
I’ve posted a very simple example to github that should show how to interact with twitters api. This uses the Twitter api ,with documentation at https://www.npmjs.com/package/twitter.
My project uses NodeJS and express to make the API call, and dotenv to access the hidden key variables in a config file. heres the repo below. https://github.com/scottmilla/Node-Twitter-Starter