How to create a basic search query to the Twitter API?


#1

beginner alert - first time using a REST API

In my application, I am expecting to receive back a JSON object. My problem: what is the URL in the browser that I enter to receive a JSON object.

For example, kiva.org also has an API from which I am able to receive JSON data, which can be tested just by going to the following link: http://api.kivaws.org/v1/journal_entries/28342/comments.json

I tried the following URL: “https://api.twitter.com/1.1/search/tweets.json?q=%40twitterapi” (given at https://dev.twitter.com/docs/using-search) but I get the following output:
{“errors”:[{“message”:“Bad Authentication data”,“code”:215}]}

How I provide authentication data here?


#2

I tried the URL: “https://api.twitter.com/1.1/search/tweets.json?q=%40twitterapi” (provided at https://dev.twitter.com/docs/using-search), but I get the following response:

{“errors”:[{“message”:“Bad Authentication data”,“code”:215}]}

Do I need to add authentication data? How to?
Thanks for any help here.


#3

Yes, all API require the use of OAuth 1.0A or our OAuth 2-based app-only auth. See [node:114] for an overview on how to use auth with our APIs.