title: Twitter API: Get top tweets by query and WOEID place
body: <p>Preferably via Tweepy in Python, I want to obtain from the Twitter API a list of top tweets for a given search query and WOEID place identifier (Yahoo's Where On Earth IDentifier).</p>
  
  <p>In my example, I obtain trending queries for a WOEID <code>id</code> via Tweepy's <code>API.trends_place(id)</code> wrapper for the Twitter REST API's GET trends/place; I then want to print the top tweets for each trending query within this place (same WOEID).</p>
  
  <p>Currently, I obtain tweets for the trending query, but</p>
  
  <ol>
  <li>not within the given place;</li>
  <li>not necessarily the "top" tweets (as opposed to, for example, "recent").</li>
  </ol>
  
  <p>How can I add these two restrictions to my search?</p>
  
  <hr>
  
  <p><strong>MWE:</strong></p>
  
  <pre><code>import tweepy
  from tweepy import OAuthHandler
  
  consumer_key = 'YOUR-CONSUMER-KEY'
  consumer_secret = 'YOUR-CONSUMER-SECRET'
  access_token = 'YOUR-ACCESS-TOKEN'
  access_secret = 'YOUR-ACCESS-SECRET'
  
  auth = OAuthHandler(consumer_key, consumer_secret)
  auth.set_access_token(access_token, access_secret)
  
  api = tweepy.API(auth)
  
  locationid = 23424775  # WOEID for Canada
  
  trendqueries = [trend['query'] for trend in api.trends_place(locationid)[0]['trends']]
  
  for trendquery in trendqueries:
      print(api.search(q=trendquery))
  </code></pre>
  
  <hr>
  
  <p><strong>What I have tried:</strong></p>
  
  <p>I can search by longitude/latitude using Tweepy's <code>API.search(q,  geocode)</code>, but I do not see an obvious way to search by WOEID.</p>