Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

298
Visualizações
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 Respostas
Responde à pergunta

0

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

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda