linkedin-api icon indicating copy to clipboard operation
linkedin-api copied to clipboard

Working with nodejs

Open tphuonglam82 opened this issue 1 year ago • 3 comments

How to use this API with Nodejs? Thanks all

tphuonglam82 avatar Oct 19 '23 09:10 tphuonglam82

@tomquirk How to use this API with Nodejs? Thanks @tomquirk

tphuonglam82 avatar Oct 20 '23 06:10 tphuonglam82

First of all i think this place is not for asking programming questions, you can go to stackoverflow for that kind of questions, because this not really "issue" or something.

Anyway let help you;

I'm using with node.js & flask server together like that:

Linkedin api back-end:

from flask import Flask
from linkedin_api import Linkedin

api = Linkedin('[email protected]', 'mysecretpass')
app = Flask(__name__)

@app.route("/")
def get_user():
    username = request.args.get('username', 'default_username')
    profile = api.get_profile_connections(username)
    return profile

Node.js client:

const axios = require('axios');
axios.get('http://127.0.0.1:5000/?username=halitsever')
  .then(function (response) {
    // handle success
    console.log(response.data);
  })
  .catch(function (error) {
    // handle error
    console.log(error);
  })
  .finally(function () {
    // always executed
  });

Another way for using linkedin api on node.js; you can use python script as child process but you should prevent multiple time logins because it can ban your linkedin account.

I hope that inspire you. @tphuonglam82

halitsever avatar Nov 08 '23 08:11 halitsever

First of all i think this place is not for asking programming questions, you can go to stackoverflow for that kind of questions, because this not really "issue" or something.

Anyway let help you;

I'm using with node.js & flask server together like that:

Linkedin api back-end:

from flask import Flask
from linkedin_api import Linkedin

api = Linkedin('[email protected]', 'mysecretpass')
app = Flask(__name__)

@app.route("/")
def get_user():
    username = request.args.get('username', 'default_username')
    profile = api.get_profile_connections(username)
    return profile

Node.js client:

const axios = require('axios');
axios.get('http://127.0.0.1:5000/?username=halitsever')
  .then(function (response) {
    // handle success
    console.log(response.data);
  })
  .catch(function (error) {
    // handle error
    console.log(error);
  })
  .finally(function () {
    // always executed
  });

Another way for using linkedin api on node.js; you can use python script as child process but you should prevent multiple time logins because it can ban your linkedin account.

I hope that inspire you. @tphuonglam82

Thank you very much @halitsever

lamtrinhphuong avatar Nov 08 '23 14:11 lamtrinhphuong