How to build a query

The best way to build a query and test if it’s valid and will return matched Tweets is to first try it at As you get a satisfactory result set, the URL loaded in the browser will contain the proper query syntax that can be reused in the API endpoint. Here’s an example:

  1. We want to search for Tweets referencing @twitterapi account. First, we run the search on
  2. Check and copy the URL loaded. In this case, we got:
  3. Replace with and you will get:
  4. Run a Twurl command to execute the search.

Please note that the API requires that the request is authenticated (check Authentication & Authorization documentation for more details on this). Also note that the search results at may return historical results, while the Search API usually only serves Tweets from the past week.