Hi all,
I am making a request to the v1.1 version of the Twitter API using the npm wrapper twitter-api-v2 to get the current trending topics. When initially making a call it told me I had Essential access, so to make this request, I would need Elevated access. I have since updated my access to Elevated, and regenerated the api key, api key secret, and my bearer token, all of which have been updated in my code. However, I am still getting the same error.
This is my code:
app.get('/', async (req, res) => {
const client = new TwitterApi(process.env.TWT_BEARER_TOKEN)
const trends = []
currentTrends = await client.v1.trendsAvailable();
for (const {name, country} of currentTrends) {
trends.push({
name,
country
})
}
res.json(trends)
})