-
Notifications
You must be signed in to change notification settings - Fork 1
Home
kgangadhar edited this page May 25, 2019
·
1 revision
The stack-exchange is a simple npm module that provides a wrapper to access StackOverflow API endpoint.
Installation is done using the npm install command:
$ npm install stack-exchange
You can make 300 requests without a key per day, with a key you can make 10,000 requests. To generate key visit here.The sections are as follows
- Users section
- Me section
- Questions section
- Answers section
- Badges section
- Tags section
- Comments section
- Posts section
- Search section
- Suggested Edits section
- Network section
- Info section
- Privilages section
- Revisions section
- Events section
For more details about the endpoints on each section visit table-of-content. To use above mentioned sections endpoints, you need to create their respective sections objects as follows:
// You can specify the version of api you want to use by passing object with version field.// if version is not provided, by default api response with version 2.2 will be providedconst stackexchange = require("stack-exchange")({ version : "2.2" });const stack_users = stackexchange.users;//for users sections endpointsconst stack_me = stackexchange.me;//for me sections endpointsconst stack_questions = stackexchange.questions; //for questions sections endpointsconst stack_answers = stackexchange.answers; //for answers sections endpointsconst stack_badges = stackexchange.badges; //for badges sections endpointsconst stack_tags = stackexchange.tags; //for tags sections endpointsconst stack_comments = stackexchange.comments;//for comments sections endpointsconst stack_posts = stackexchange.posts;//for posts sections endpointsconst stack_search = stackexchange.search;//for search sections endpointsconst stack_suggested_edits = stackexchange.suggested_edits;//for suggested_edits sections endpointsconst stack_network = stackexchange.network;//for network sections endpointsconst stack_info = stackexchange.info; //for info sections endpointsconst stack_privilages = stackexchange.privilages; //for privilages sections endpointsconst stack_revisions = stackexchange.revisions; //for revisions sections endpointsconst stack_events = stackexchange.events; //for events sections endpoints