node-twitter-api-v2 icon indicating copy to clipboard operation
node-twitter-api-v2 copied to clipboard

Setting options of method .userByUsername() causes error

Open vanetreg opened this issue 2 years ago • 1 comments

The referred method is this linked: single-user-by-username

I want to get back also optional user fields with this method, using this: const user = await readOnlyClient.v2.userByUsername(userName, { 'user.fields': [ 'username', 'name', 'id', 'created_at', 'description', 'entities', 'public_metrics', 'url', 'verified'] });

but it gives error 400 back: rateLimit: { limit: 300, remaining: 299, reset: 1673469737 }, data: { errors: [ [Object] ], title: 'Invalid Request', detail: 'One or more parameters to your request was invalid.', type: 'https://api.twitter.com/2/problems/invalid-request' }

I could only check type definition files and I suppose I added options object correctly to method.

Any help is appreciated :)

vanetreg avatar Jan 11 '23 20:01 vanetreg

did you figure out this issue? i'm running into it now and discovering just how useless a lot of the available documentation is.

Onoh9 avatar Nov 21 '23 19:11 Onoh9