How to build a standard query

Please note:

We launched a new version of the standard Search Tweets endpoint as part of Twitter API v2: Early Access. If you are currently using any of these endpoints, you can use our migration materials to start working with the newer endpoint.

To see all of Twitter's search endpoint offerings, please visit our search overview.

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.