PLhery / node-twitter-api-v2

Strongly typed, full-featured, light, versatile yet powerful Twitter API v1.1 and v2 client for Node.js.
https://www.npmjs.com/package/twitter-api-v2
Apache License 2.0
1.25k stars 175 forks source link

Setting options of method .userByUsername() causes error #435

Open vanetreg opened 1 year ago

vanetreg commented 1 year ago

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 :)

Onoh9 commented 8 months ago

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