0

I'm trying to develop a meteor application and in that i want to get the data of a user from stackoverlow.

Suppose, My username is

https://stackoverflow.com/users/1934044/user1934044

When user enters this link in my textbox i want to get the info about this user

For this, Do we need to register an application in stack apps or we can directly get the data from stackexchange api.

I'm not using the stackexchange login system(OAUTH) in my app.

If we can directly get the data, how to do it

Can someont point me to the tutorial

Community
  • 1
  • 1
user1934044
  • 516
  • 5
  • 18

2 Answers2

0

You can get User Details by user ID with following methods endpoint :

  • /users/{ids}

For more details, Refer below Stack Exchange Document

https://api.stackexchange.com/docs/users-by-ids

Or

I have written Java Wrapper over Stack Exchange API.

You can try it out. https://github.com/sanjivsingh/stackoverflow-java-sdk

Sample code :

StackExchangeApiQueryFactory queryFactory  = StackExchangeApiQueryFactory.newInstance();
System.out.println("get user by Id");
PagedList<User> users = queryFactory.newUserApiQuery()
        .withUserIds(1934044).listUserByIds();

Coming back to your question :

  • You need not register application for that.

  • This method will work without any applicationKey and accessToken

Sanjiv
  • 1,795
  • 1
  • 29
  • 45
0

You can use the Meteor Http package for this to call the api and get the data as json object.

Eg:

On server,

return Meteor.methods({

    getUserData: function (user_id) {
        var url =   "give the api url"+user_id;
        this.unblock();
        return Meteor.http.get(url);
    }

});
anoop
  • 539
  • 4
  • 20