Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

292
Views
How to fetch Twitter Username and Profile Photo using the Twit NPM Package

I am making use of the twit npm pacakge as below to get the Authenticated Twitter Username and Profile Image amongst other information.

        const Twit = require('twit');

        let T = new Twit({
            consumer_key: 'xxx',
            consumer_secret: 'xxx',
            access_token: 'xxx',
            access_token_secret: 'xxx',
            timeout_ms: 60 * 1000,  
            strictSSL: true,
        });
        T.get('users/show.json', { screen_name: `${usernameFromAbove}`}, function (err, data, response) {
            if (err) {
                console.log(`User Fetch Error`);
                console.log(err);
            }
            console.log(data);
        });

Unfortunately the response I keep getting is this:

2021-09-23T23:38:55.659299+00:00 app[web.1]:   errors: [ { message: 'Sorry, that page does not exist', code: 34 } ]

Am I calling the wrong endpoint? I'm currently confused?

Any insight to resolve this would be greatly appreciated.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The endpoint is 'users/show' not 'users/show.json'.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!