TLDR: The documentation shows a method of getting all tweets within a radius of a lat/lng position. Running this example verbatim results in an authentication error. The following API call is documented here: Using standard search | Docs | Twitter Developer Platform

You want: all recent Tweets in Portuguese, near Maracanã soccer stadium in Rio de Janeiro
Your search URL is: https://api.twitter.com/1.1/search/tweets.json?q=geocode=-22.912214,-43.230182,1km&lang=pt&result_type=recent

Implementing this in NodeJS with twit:

t.get('https://api.twitter.com/1.1/search/tweets.json?q=geocode=-22.912214,-43.230182,1km&lang=pt&result_type=recent', (err: Error, result: Object, response: any) => {
    console.log(result);
})

result: { errors: [ { code: 32, message: 'Could not authenticate you.' } ] }

I think there is a typo in the documentation example. It should be: https://api.twitter.com/1.1/search/tweets.json?q=&geocode=-22.912214,-43.230182,1km&lang=pt&result_type=recent

An & character for separating the query field from the geocode field is missing.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.