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
- privileges 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 provided
const stackexchange = require("stack-exchange")({ version : "2.2" });
const stack_users = stackexchange.users;//for users sections endpoints
const stack_me = stackexchange.me;//for me sections endpoints
const stack_questions = stackexchange.questions; //for questions sections endpoints
const stack_answers = stackexchange.answers; //for answers sections endpoints
const stack_badges = stackexchange.badges; //for badges sections endpoints
const stack_tags = stackexchange.tags; //for tags sections endpoints
const stack_comments = stackexchange.comments;//for comments sections endpoints
const stack_posts = stackexchange.posts;//for posts sections endpoints
const stack_search = stackexchange.search;//for search sections endpoints
const stack_suggested_edits = stackexchange.suggested_edits;//for suggested_edits sections endpoints
const stack_network = stackexchange.network;//for network sections endpoints
const stack_info = stackexchange.info; //for info sections endpoints
const stack_privileges = stackexchange.privileges; //for privileges sections endpoints
const stack_revisions = stackexchange.revisions; //for revisions sections endpoints
const stack_events = stackexchange.events; //for events sections endpoints
All user methods that take an {ids} parameter have a /me equivalent method that takes an access_token instead.
// users object
const stack_users = stackexchange.users;
Get all users on the site.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// using users endpoint
stack_users.users(users_options, (response) => {
console.log(response);
});
Get the users identified by a set of ids.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// id of the user
let user_ids = "6414102";
// using users_by_ids endpoint
stack_users.users_by_ids(user_ids, users_options, (response) => {
console.log(response);
});
Get the answers posted by the users identified by a set of ids.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// id of the user
let user_ids = "6414102";
// using answers_on_users endpoint
stack_users.answers_on_users(user_ids, users_options, (response) => {
console.log(response);
});
Get the badges earned by the users identified by a set of ids.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// id of the user
let user_ids = "6414102";
// using badges_on_users endpoint
stack_users.badges_on_users(user_ids, users_options, (response) => {
console.log(response);
});
Get the comments posted by the users identified by a set of ids.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// id of the user
let user_ids = "6414102";
// using comments_on_users endpoint
stack_users.comments_on_users(user_ids, users_options, (response) => {
console.log(response);
});
Get the comments posted by a set of users in reply to another user.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// id of the user
let user_ids = "6414102";
// id of another user
let toid = 1427878;
// using comments_by_users_to_user endpoint
stack_users.comments_by_users_to_user(user_ids, toid , users_options, (response) => {
console.log(response);
});
Get the questions favorited by users identified by a set of ids.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// id of the user
let user_ids = "6414102";
// using favorites_on_users endpoint
stack_users.favorites_on_users(user_ids, users_options, (response) => {
console.log(response);
});
Get the comments that mention one of the users identified by a set of ids.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// id of the user
let user_ids = "6414102";
// using mentions_on_users endpoint
stack_users.mentions_on_users(user_ids, users_options, (response) => {
console.log(response);
});
Gets a user's activity across the Stack Exchange network.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// id of the user
let user_ids = "6414102";
// using users_network_activity endpoint
stack_users.users_network_activity(user_ids, users_options, (response) => {
console.log(response);
});
Get a user's notifications.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// id of the user
let user_ids = "6414102";
// using user_notifications endpoint
stack_users.user_notifications(user_ids, users_options, (response) => {
console.log(response);
});
Get a user's unread notifications.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// id of the user
let user_ids = "6414102";
// using user_unread_notifications endpoint
stack_users.user_unread_notifications(user_ids, users_options, (response) => {
console.log(response);
});
Get all posts (questions and answers) owned by a set of users.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// id of the user
let user_ids = "6414102";
// using posts_on_users endpoint
stack_users.posts_on_users(user_ids, users_options, (response) => {
console.log(response);
});
Get the privileges the given user has on the site.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// id of the user
let user_ids = "6414102";
// using privileges_on_users endpoint
stack_users.privileges_on_users(user_ids, users_options, (response) => {
console.log(response);
});
Get the questions asked by the users identified by a set of ids.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// id of the user
let user_ids = "6414102";
// using questions_on_users endpoint
stack_users.questions_on_users(user_ids, users_options, (response) => {
console.log(response);
});
Get the questions on which a set of users, have active bounties.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// id of the user
let user_ids = "6414102";
// using featured_questions_on_users endpoint
stack_users.featured_questions_on_users(user_ids, users_options, (response) => {
console.log(response);
});
Get the questions asked by a set of users, which have no answers.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// id of the user
let user_ids = "6414102";
// using no_answer_questions_on_users endpoint
stack_users.no_answer_questions_on_users(user_ids, users_options, (response) => {
console.log(response);
});
Get the questions asked by a set of users, which have at least one answer but no accepted answer.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// id of the user
let user_ids = "6414102";
// using unaccepted_questions_on_users endpoint
stack_users.unaccepted_questions_on_users(user_ids, users_options, (response) => {
console.log(response);
});
Get the questions asked by a set of users, which are not considered to be adequately answered.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// id of the user
let user_ids = "6414102";
// using unanswered_questions_on_users endpoint
stack_users.unanswered_questions_on_users(user_ids, users_options, (response) => {
console.log(response);
});
Get a subset of the reputation changes experienced by the users identified by a set of ids.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// id of the user
let user_ids = "6414102";
// using reputation_on_users endpoint
stack_users.reputation_on_users(user_ids, users_options, (response) => {
console.log(response);
});
Get a history of a user's reputation, excluding private events.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// id of the user
let user_ids = "6414102";
// using reputation_history endpoint
stack_users.reputation_history(user_ids, users_options, (response) => {
console.log(response);
});
Get a full history of a user's reputation. auth required
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// id of the user
let user_ids = "6414102";
// using full_reputation_history endpoint
stack_users.full_reputation_history(user_ids, users_options, (response) => {
console.log(response);
});
Get the tags that the users (identified by a set of ids) have been active in.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// id of the user
let user_ids = "6414102";
// using tags_on_users endpoint
stack_users.tags_on_users(user_ids, users_options, (response) => {
console.log(response);
});
Get the suggested edits provided by users identified by a set of ids.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// id of the user
let user_ids = "6414102";
// using suggested_edits_on_users endpoint
stack_users.suggested_edits_on_users(user_ids, users_options, (response) => {
console.log(response);
});
Get the top answers a user has posted on questions with a set of tags.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// id of the user
let user_ids = "6414102";
//user tags
let tags = "nodejs";
// using top_user_answers_in_tags endpoint
stack_users.top_user_answers_in_tags(user_ids, tags, users_options, (response) => {
console.log(response);
});
Get the top questions a user has posted with a set of tags.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// id of the user
let user_ids = "6414102";
//user tags
let tags = "nodejs";
// using top_user_questions_in_tags endpoint
stack_users.top_user_questions_in_tags(user_ids, tags, users_options, (response) => {
console.log(response);
});
Get a subset of the actions of that have been taken by the users identified by a set of ids.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// id of the user
let user_ids = "6414102";
// using timeline_on_users endpoint
stack_users.timeline_on_users(user_ids, users_options, (response) => {
console.log(response);
});
Get the top tags (by score) a single user has posted answers in.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// id of the user
let user_ids = "6414102";
// using top_answer_tags_on_users endpoint
stack_users.top_answer_tags_on_users(user_ids, users_options, (response) => {
console.log(response);
});
Get the top tags (by score) a single user has posted in.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// id of the user
let user_ids = "6414102";
// using top_tags_on_users endpoint
stack_users.top_tags_on_users(user_ids, users_options, (response) => {
console.log(response);
});
Get the top tags (by score) a single user has asked questions in.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// id of the user
let user_ids = "6414102";
// using top_question_tags_on_users endpoint
stack_users.top_question_tags_on_users(user_ids, users_options, (response) => {
console.log(response);
});
Get the users who have moderation powers on the site.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// using moderators endpoint
stack_users.moderators(users_options, (response) => {
console.log(response);
});
Get the users who are active moderators who have also won a moderator election.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// using elected_moderators endpoint
stack_users.elected_moderators(users_options, (response) => {
console.log(response);
});
Get a user's inbox. auth required
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// id of the user
let user_ids = "6414102";
// using user_inbox endpoint
stack_users.user_inbox(user_ids, users_options, (response) => {
console.log(response);
});
Get the unread items in a user's inbox. auth required
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// id of the user
let user_ids = "6414102";
// using user_unread_inbox endpoint
stack_users.user_unread_inbox(user_ids, users_options, (response) => {
console.log(response);
});
Get a user's associated accounts.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// id of the user
let user_ids = "6414102";
// using associated_users endpoint
stack_users.associated_users(user_ids, users_options, (response) => {
console.log(response);
});
Get the merges a user's accounts has undergone.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// id of the user
let user_ids = "6414102";
// using merge_history endpoint
stack_users.merge_history(user_ids, users_options, (response) => {
console.log(response);
});
/me are users equivalent methods that takes an access_token instead. These methods are provided for developer convenience, with the exception of plain /me, which is actually necessary for discovering which user authenticated to an application.
// me object
const stack_me = stackexchange.me;
Get the users identified by a set of ids.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// using users endpoint
stack_me.me( users_options, (response) => {
console.log(response);
});
Get the answers posted by the users identified by a set of ids.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// using me_answers endpoint
stack_me.me_answers( users_options, (response) => {
console.log(response);
});
Get the badges earned by the users identified by a set of ids.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// using me_badges endpoint
stack_me.me_badges( users_options, (response) => {
console.log(response);
});
Get the comments posted by the users identified by a set of ids.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// using me_comments endpoint
stack_me.me_comments( users_options, (response) => {
console.log(response);
});
Get the comments posted by a set of users in reply to another user.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
//another user_id
let toid = 1427878;
// using me_comments_to endpoint
stack_me.me_comments_to(toid, users_options, (response) => {
console.log(response);
});
Get the questions favorited by users identified by a set of ids.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// using me_favorites endpoint
stack_me.me_favorites(users_options, (response) => {
console.log(response);
});
Get the comments that mention one of the users identified by a set of ids.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// using me_mentioned endpoint
stack_me.me_mentioned(users_options, (response) => {
console.log(response);
});
Gets a user's activity across the Stack Exchange network.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// using me_network_activity endpoint
stack_me.me_network_activity(users_options, (response) => {
console.log(response);
});
Get a user's notifications.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// using me_notifications endpoint
stack_me.me_notifications(users_options, (response) => {
console.log(response);
});
Get a user's unread notifications.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// using me_unread_notifications endpoint
stack_me.me_unread_notifications(users_options, (response) => {
console.log(response);
});
Get all posts (questions and answers) owned by a set of users.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// using me_posts endpoint
stack_me.me_posts(users_options, (response) => {
console.log(response);
});
Get the privileges the given user has on the site.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// using me_privileges endpoint
stack_me.me_privileges(users_options, (response) => {
console.log(response);
});
Get the questions asked by the users identified by a set of ids.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// using me_questions endpoint
stack_me.me_questions(users_options, (response) => {
console.log(response);
});
Get the questions on which a set of users, have active bounties.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// using me_featured_questions endpoint
stack_me.me_featured_questions(users_options, (response) => {
console.log(response);
});
Get the questions asked by a set of users, which have no answers.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// using me_no_answer_questions endpoint
stack_me.me_no_answer_questions(users_options, (response) => {
console.log(response);
});
Get the questions asked by a set of users, which have at least one answer but no accepted answer.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// using me_unaccepted_questions endpoint
stack_me.me_unaccepted_questions(users_options, (response) => {
console.log(response);
});
Get the questions asked by a set of users, which are not considered to be adequately answered.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// using me_unanswered_questions endpoint
stack_me.me_unanswered_questions(users_options, (response) => {
console.log(response);
});
Get a subset of the reputation changes experienced by the users identified by a set of ids.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// using me_reputation endpoint
stack_me.me_reputation(users_options, (response) => {
console.log(response);
});
Get a history of a user's reputation, excluding private events.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// using me_reputation_history endpoint
stack_me.me_reputation_history(users_options, (response) => {
console.log(response);
});
Get a full history of a user's reputation. auth required
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// using me_full_reputation_history endpoint
stack_me.me_full_reputation_history(users_options, (response) => {
console.log(response);
});
Get the suggested edits provided by users identified by a set of ids.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// using me_suggested_edits endpoint
stack_me.me_suggested_edits(users_options, (response) => {
console.log(response);
});
Get the tags that the users (identified by a set of ids) have been active in.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// using me_tags endpoint
stack_me.me_tags(users_options, (response) => {
console.log(response);
});
Get the top questions a user has posted with a set of tags.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
//user tags
let tags = "nodejs";
// using me_tags_top_questions endpoint
stack_me.me_tags_top_questions(tags, users_options, (response) => {
console.log(response);
});
Get the top answers a user has posted on questions with a set of tags.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
//user tags
let tags = "nodejs";
// using me_tags_top_answers endpoint
stack_me.me_tags_top_answers(tags, users_options, (response) => {
console.log(response);
});
Get the top tags (by score) a single user has posted answers in.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// using me_top_answer_tags endpoint
stack_me.me_top_answer_tags( users_options, (response) => {
console.log(response);
});
Get the top tags (by score) a single user has asked questions in.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// using me_top_question_tags endpoint
stack_me.me_top_question_tags( users_options, (response) => {
console.log(response);
});
Get a subset of the actions of that have been taken by the users identified by a set of ids.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// using me_timeline endpoint
stack_me.me_timeline(users_options, (response) => {
console.log(response);
});
Get the top tags (by score) a single user has posted in.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// using me_top_tags endpoint
stack_me.me_top_tags( users_options, (response) => {
console.log(response);
});
Get a user's inbox. auth required
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// using me_inbox endpoint
stack_me.me_inbox( users_options, (response) => {
console.log(response);
});
Get the unread items in a user's inbox. auth required
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// using me_unread_inbox endpoint
stack_me.me_unread_inbox( users_options, (response) => {
console.log(response);
});
Get a user's associated accounts.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// using me_associated_users endpoint
stack_me.me_associated_users(users_options, (response) => {
console.log(response);
});
Get the merges a user's accounts has undergone.
//options for users
let users_options = {
"key": "your_key",
"access_token": "your_token"
}
// using me_merge_history endpoint
stack_me.me_merge_history(inbox_options, (response) => {
console.log(response);
});
The options object is optional, can be an empty object also. update all your query fields in it. supported query fields are as follows:
let options = {
"order": "desc",
"sort": "activity",
"site": "stackoverflow",
"key" : "your_key"
}
// questions object
const stack_questions = stackexchange.questions;
Get all questions on the site.
// using questions endpoint
stack_questions.questions(options , (response) => {
// response will be json
console.log(response);
});
Get the questions identified by a set of ids.
ids = "47559184"
// using questions_by_ids endpoint
stack_questions.questions_by_ids(ids , options , (response) => {
// response will be json
console.log(response);
});
Get the answers to the questions identified by a set of ids.
id = "47596027"
// using answers_on_questions endpoint
stack_questions.answers_on_questions(id, options , (response) => {
// response will be json
console.log(response);
});
Renders a hypothetical answer to a question. This is a post endpoints, the options section looks like this, both fields are required.
let options = {
"body": "hello",
"site": "stackoverflow"
}
// id of the question
let id = "47596027"
// using render_answer endpoint
stack_questions.render_answer(id, options , (response) => {
// response returns hypothetical solution
console.log(response);
});
Get the questions that link to the questions identified by a set of ids.
// id of the question
let id = "1884724";
// using answers_on_questions endpoint
stack_questions.linked_questions(id, options , (response) => {
console.log(response);
});
Get the questions that are related to the questions identified by a set of ids.
// id of the question
let id = "37878662";
// using related_questions endpoint
stack_questions.related_questions(id, options , (response) => {
console.log(response);
});
Get the timelines of the questions identified by a set of ids.
// id of the question
let id = "37878662";
// using questions_timeline endpoint
stack_questions.questions_timeline(id, options, (response) => {
console.log(response);
});
Get all questions on the site with active bounties.
// using featured_questions endpoint
stack_questions.featured_questions(options, (response) => {
//will return featured questions
console.log(response);
});
Get all questions on the site with no answers.
// using no_answer_questions endpoint
stack_questions.no_answer_questions( options , (response) => {
// will return no-answer questions
console.log(response);
});
Get all questions the site considers unanswered.
// using unanswered_questions endpoint
stack_questions.unanswered_questions( options , (response) => {
//returns unanswered questions details
console.log(response);
});
Get questions the site considers unanswered within a user's favorite or interesting tags. auth required This endpoint required access_token and key in options.
// using unanswered_questions_my_tags endpoint
stack_questions.unanswered_questions_my_tags( options , (response) => {
console.log(response);
});
Returns valid flag options for the given question. auth required. This endpoint required access_token and key in options.
let options = {
"key": "your_key",
"access_token": "your_token",
"site": "stackoverflow"
}
let question_id = "37878662";
// using question_flag_options endpoint
stack_questions.question_flag_options(question_id, options, (response) => {
console.log(response);
});
Returns valid flag options which are also close reasons for the given question. auth required. This endpoint required access_token and key in options.
let options = {
"key": "your_key",
"access_token": "your_token",
"site": "stackoverflow"
}
let question_id = "37878662";
// using question_close_options endpoint
stack_questions.question_close_options(question_id, options, (response) => {
console.log(response);
});
Get the comments on the questions identified by a set of ids. This endpoint required access_token and key in options.
let options = {
"key": "your_key",
"access_token": "your_token",
"site": "stackoverflow"
}
let question_id = "45934757";
// using comments_on_questions endpoint
stack_questions.comments_on_questions(question_id, options, (response) => {
console.log(response);
});
The options object is optional, can be an empty object also. update all your query fields in it.
// answers object
const stack_answers = stackexchange.answers;
Get all answers on the site.
// answer query options
let options = {
"key": "your_key",
"access_token": "your_token"
}
// using answers endpoint
stack_answers.answers(answers_options, (response) => {
console.log(response);
});
Get answers identified by a set of ids.
// query options
let options = {
"key": "your_key",
"access_token": "your_token"
}
//id of the answer
let answer_id = "6414102";
// using answers_by_ids endpoint
stack_answers.answers_by_ids(answer_id, answers_options, (response) => {
console.log(response);
});
Casts an accept vote on the given answer. auth required
// query options
let options = {
"key": "your_key",
"access_token": "your_token"
}
//id of the answer
let answer_id = "6414102";
// using accept_answer endpoint
stack_answers.accept_answer(answer_id, answers_options, (response) => {
console.log(response);
});
Undoes an accept vote on the given answer. auth required
// query options
let options = {
"key": "your_key",
"access_token": "your_token"
}
//id of the answer
let answer_id = "47451356";
// using undo_accept_answer endpoint
stack_answers.undo_accept_answer(answer_id, answers_options, (response) => {
console.log(response);
});
Get comments on the answers identified by a set of ids.
// query options
let options = {
"key": "your_key",
"access_token": "your_token"
}
//id of the answer
let answer_id = "37886434";
// using comments_on_answers endpoint
stack_answers.comments_on_answers(answer_id, answers_options, (response) => {
console.log(response);
});
let badges_options = {
"site": "stackoverflow",
"key": "U4DMV*8nvpm3EOpvf69Rxw(("
}
// badges object
const stack_badges = stackexchange.badges;
Get all badges on the site, in alphabetical order.
// using badges endpoint
stack_badges.badges(badges_options, (response) => {
// response will be json
console.log(response);
});
Get the badges identified by ids.
// id of the badge
let id = "222"
// using badges_by_id endpoint
stack_badges.badges_by_id(id, badges_options, (response) => {
// response will be json
console.log(response);
});
Get all non-tagged-based badges in alphabetical order.
// name of the badge
let name = "fanatic"
// using badges_by_name endpoint
stack_badges.badges_by_name(name, badges_options, (response) => {
// response will be json
console.log(response);
});
Get badges recently awarded on the site.
// options fields are as follows
let options = {
"site": "stackoverflow"
}
// using badge_recipients endpoint
stack_badges.badge_recipients( options, (response) => {
// response will be json
console.log(response);
});
Get the recent recipients of the given badges.
// options fields are as follows
let options = {
"site": "stackoverflow"
}
// id of the badge
let id = "222"
// using badge_recipients_by_id endpoint
stack_badges.badge_recipients_by_id(id, badges_options, (response) => {
// response will be json
console.log(response);
});
Get all tagged-based badges in alphabetical order.
// options fields are as follows
let options = {
"order": "desc",
"sort": "popular",
"site": "stackoverflow"
}
// using badge_by_tags endpoint
stack_badges.badge_by_tags(options, (response) => {
// response will be json
console.log(response);
});
let tags_options = {
"site": "stackoverflow",
"key": "your_key"
}
// tags object
const stack_tags = stackexchange.tags;
Get the tags on the site.
// using tags endpoint
stack_tags.tags(tags_options, (response) => {
console.log(response);
});
Get tags on the site by their names.
//tag name for search
let tag_name = "nodejs"
// using tags_by_name endpoint
stack_tags.tags_by_name(tag_name, tags_options, (response) => {
console.log(response);
});
Get the tags on the site that only moderators can use.
// using moderator_only_tags endpoint
stack_tags.moderator_only_tags(tags_options, (response) => {
console.log(response);
});
Get the tags on the site that fulfill required tag constraints.
// using require_tags endpoint
stack_tags.require_tags(tags_options, (response) => {
console.log(response);
});
Get all the tag synonyms on the site.
// using tag_synonyms endpoint
stack_tags.tag_synonyms(tags_options, (response) => {
console.log(response);
});
Get frequently asked questions in a set of tags.
//tag name for search
let tag_name = "nodejs"
// using faqs_by_tags endpoint
stack_tags.faqs_by_tags(tag_name, tags_options, (response) => {
console.log(response);
});
Get related tags, based on common tag pairings.
//tag name for search
let tag_name = "nodejs"
// using related_tags endpoint
stack_tags.related_tags(tag_name, tags_options, (response) => {
console.log(response);
});
Get the synonyms for a specific set of tags.
//tag name for search
let tag_name = "nodejs"
// using synonyms_by_tags endpoint
stack_tags.synonyms_by_tags(tag_name, tags_options, (response) => {
console.log(response);
});
Get the top answer posters in a specific tag, either in the last month or for all time.
//tag name for search
let tag_name = "java"
// using top_answerers_on_tags endpoint
stack_tags.top_answerers_on_tags(tag_name, tags_options, (response) => {
console.log(response);
});
Get the top question askers in a specific tag, either in the last month or for all time.
//tag name for search
let tag_name = "java"
// using top_askers_on_tags endpoint
stack_tags.top_askers_on_tags(tag_name, tags_options, (response) => {
console.log(response);
});
Get the wiki entries for a set of tags.
//tag name for search
let tag_name = "java"
// using wikis_by_tags endpoint
stack_tags.wikis_by_tags(tag_name, tags_options, (response) => {
console.log(response);
});
// comments object
const stack_comments = stackexchange.comments;
Get all comments on the site. comments_options can be empty object.
let comments_options = {
"key": "your_key",
"access_token": "your_token"
}
// using comments endpoint
stack_comments.comments(comments_options, (response) => {
console.log(response);
});
Get comments identified by a set of ids.
//options for comments
let comments_options = {
"key": "your_key",
"access_token": "your_token"
}
//id of the comment
let comment_id = "131321";
// using comments_by_ids endpoint
stack_comments.comments_by_ids(comment_id, comments_options, (response) => {
console.log(response);
});
Delete a comment identified by its id. auth required
//options for comments
let comments_options = {
"key": "your_key",
"access_token": "your_token"
}
//id of the comment
let comment_id = "12135";
// using delete_comment endpoint
stack_comments.delete_comment(comment_id, comments_options, (response) => {
console.log(response);
});
Edit a comment identified by its id. auth required. body is required in options
//options for comments
let comments_options = {
"body": "edited comment"
"key": "your_key",
"access_token": "your_token"
}
//id of the comment
let comment_id = "12135";
// using edit_comment endpoint
stack_comments.edit_comment(comment_id, comments_options, (response) => {
console.log(response);
});
Casts a flag on the given comment. auth required. option_id is required in options
//options for comments
let comments_options = {
"option_id": "1323"
"key": "your_key",
"access_token": "your_token"
}
//id of the comment
let comment_id = "12135";
// using create_comment_flag endpoint
stack_comments.create_comment_flag(comment_id, comments_options, (response) => {
console.log(response);
});
Returns valid flag options for the given comment. auth required
//options for comments
let comments_options = {
"key": "your_key",
"access_token": "your_token"
}
//id of the comment
let comment_id = "12135";
// using comment_flag_options endpoint
stack_comments.comment_flag_options(comment_id, comments_options, (response) => {
console.log(response);
});
Casts an upvote on the given comment. auth required
//options for comments
let comments_options = {
"key": "your_key",
"access_token": "your_token"
}
//id of the comment
let comment_id = "12135";
// using upvote_comment endpoint
stack_comments.upvote_comment(comment_id, comments_options, (response) => {
console.log(response);
});
Undoes an upvote on the given comment. auth required
//options for comments
let comments_options = {
"key": "your_key",
"access_token": "your_token"
}
//id of the comment
let comment_id = "12135";
// using undo_upvote_comment endpoint
stack_comments.undo_upvote_comment(comment_id, comments_options, (response) => {
console.log(response);
});
// posts object
const stack_posts = stackexchange.posts;
Get all posts (questions and answers) in the system. posts_options can be empty object.
let posts_options = {
"key": "your_key",
"access_token": "your_token"
}
// using posts endpoint
stack_posts.posts(posts_options, (response) => {
console.log(response);
});
Get all posts identified by a set of ids. Useful for when the type of post (question or answer) is not known.
let posts_options = {
"key": "your_key",
"access_token": "your_token"
}
//id of the post
let post_id = "45934757";
// using posts_by_ids endpoint
stack_posts.posts_by_ids(post_id, posts_options, (response) => {
console.log(response);
});
Get comments on the posts (question or answer) identified by a set of ids.
let posts_options = {
"key": "your_key",
"access_token": "your_token"
}
//id of the post
let post_id = "45934757";
// using comments_on_posts endpoint
stack_posts.comments_on_posts(post_id, posts_options, (response) => {
console.log(response);
});
Create a new comment on the post identified by id. auth required. the comment should be included in options as body.
// body is required field.
let posts_options = {
"body": "Adding test comment"
"key": "your_key",
"access_token": "your_token"
}
//id of the post
let post_id = "45934757";
// using create_comment endpoint
stack_posts.create_comment(post_id, posts_options, (response) => {
console.log(response);
});
Renders a hypothetical comment on the given post.
let posts_options = {
"key": "your_key",
"access_token": "your_token"
}
//id of the post
let post_id = "45934757";
// using render_comment endpoint
stack_posts.render_comment(post_id, {}, (response) => {
console.log(response);
});
Get revisions on the set of posts in ids.
let posts_options = {
"key": "your_key",
"access_token": "your_token"
}
//id of the post
let post_id= 39892422;
// using revisions_by_ids endpoint
stack_posts.revisions_by_ids(post_id, posts_options, (response) => {
console.log(response);
});
Get suggested edits on the set of posts in ids. `
let posts_options = {
"key": "your_key",
"access_token": "your_token"
}
//id of the post
let post_id= 39892422;
// using posts_on_suggested_edits endpoint
stack_posts.posts_on_suggested_edits(post_id, posts_options, (response) => {
console.log(response);
});
// search object
const stack_search = stackexchange.search;
Search the site for questions meeting certain criteria. search_options must contain one of tagged or intitle field.
let search_options = {
"tagged": "nodejs",
"key": "your_key",
"access_token": "your_token"
}
// using search endpoint
stack_search.search(search_options, (response) => {
console.log(response);
});
Search the site for questions using most of the on-site search options. for more search_options please visit advanced_search endpoint of stackexchange.
let search_options = {
"key": "your_key",
"access_token": "your_token"
}
// using advanced_search endpoint
stack_search.advanced_search(search_options, (response) => {
console.log(response);
});
Search the site based on similarity to a title. title must be set in search_options.
let search_options = {
"title": "npm install error",
"key": "your_key",
"access_token": "your_token"
}
// using similar endpoint
stack_search.similar(search_options, (response) => {
console.log(response);
});
Searches a site. For more search_options see excerpt_search endpoint of stackexchange.
let search_options = {
"key": "your_key",
"access_token": "your_token"
}
// using excerpt_search endpoint
stack_search.excerpt_search(search_options, (response) => {
console.log(response);
});
let suggested_edits_options = {
"key": "your_key",
"access_token": "your_token"
}
// suggested_edits object
const stack_suggested_edits = stackexchange.suggested_edits;
Get all the suggested edits on the site. options is optional, can be an empty object
// using suggested_edits endpoint
stack_suggested_edits.suggested_edits(suggested_edits_options, (response) => {
console.log(response);
});
Get the suggested edits identified by a set of ids. options is optional, can be an empty object
// id of the suggested_edit
let suggested_edit_id = "3445738"
// using suggested_edits_by_ids endpoint
stack_suggested_edits.suggested_edits_by_ids(suggested_edit_id, suggested_edits_options, (response) => {
console.log(response);
});
These methods return data across the entire Stack Exchange network of sites. Accordingly, you do not pass a site parameter to them.
// network object
const stack_network = stackexchange.network;
Allows an application to dispose of access_tokens when it is done with them.
//options for users
let invalidate_options = {
"key": "your_key",
"access_token": "your_token"
}
// using invalidate_access_tokens endpoint
stack_network.invalidate_access_tokens(invalidate_options, (response) => {
console.log(response);
});
Allows an application to inspect access_tokens it has, useful for debugging.
//options for users
let read_options = {
"key": "your_key",
"access_token": "your_token"
}
// using read_access_tokens endpoint
stack_network.read_access_tokens( read_options, (response) => {
console.log(response);
});
Allows an application to de-authorize itself for a set of users.
//options for users
let read_options = {
"key": "your_key",
"access_token": "your_token"
}
// using application_de_authenticate endpoint
stack_network.application_de_authenticate( read_options, (response) => {
console.log(response);
});
Get descriptions of all the errors that the API could return.
//options for users
let read_options = {
"key": "your_key",
"access_token": "your_token"
}
// using errors endpoint
stack_network.errors( read_options, (response) => {
console.log(response);
});
Simulate an API error for testing purposes.
//options for users
let read_options = {
"key": "your_key",
"access_token": "your_token"
}
let error_id = "401";
// using simulate_errors endpoint
stack_network.simulate_errors(error_id, read_options, (response) => {
console.log(response);
});
Create a new filter.
//options for users
let read_options = {
"include": ".quota_max",
"exclude": ".quota_remaining",
"unsafe": false
"key": "your_key",
"access_token": "your_token"
}
// using create_filter endpoint
stack_network.create_filter(create_filter_options, (response) => {
console.log(response);
});
Decode a set of filters, useful for debugging purposes.
//options for users
let read_options = {
"key": "your_key",
"access_token": "your_token"
}
let filter = ".quota_max"
// using read_filter endpoint
stack_network.read_filter(filter, read_options, (response) => {
console.log(response);
});
Get a user's inbox, outside of the context of a site. auth required
//options for users
let inbox_options = {
"key": "your_key",
"access_token": "your_token"
}
// using inbox endpoint
stack_network.inbox(inbox_options, (response) => {
console.log(response);
});
Get the unread items in a user's inbox, outside of the context of a site. auth required
//options for users
let inbox_options = {
"key": "your_key",
"access_token": "your_token"
}
// using inbox_unread endpoint
stack_network.inbox_unread(inbox_options, (response) => {
console.log(response);
});
Get a user's notifications, outside of the context of a site. auth required
//options for users
let inbox_options = {
"key": "your_key",
"access_token": "your_token"
}
// using notifications endpoint
stack_network.notifications(inbox_options, (response) => {
console.log(response);
});
Get a user's notifications, outside of the context of a site. auth required
//options for users
let inbox_options = {
"key": "your_key",
"access_token": "your_token"
}
// using unread_notifications endpoint
stack_network.unread_notifications(inbox_options, (response) => {
console.log(response);
});
Get all the sites in the Stack Exchange network.
//options for users
let inbox_options = {
"key": "your_key",
"access_token": "your_token"
}
// using sites endpoint
stack_network.sites(inbox_options, (response) => {
console.log(response);
});
let info_options = {
"site": "stackoverflow"
}
// info object
const stack_info = stackexchange.info;
Get information about the entire site.
// using info endpoint
stack_info.info(info_options, (response) => {
// response will be json
console.log(response);
});
let privileges_options = {
"site": "stackoverflow",
"key" : "your_key"
}
// privileges object
const stack_privileges = stackexchange.privileges;
Get all the privileges available on the site.
// using info endpoint
stack_privileges.privileges(privileges_options, (response) => {
// response will be json
console.log(response);
});
let revisions_options = {
"site": "stackoverflow",
"key" : "your_key"
}
// privileges object
const stack_revisions = stackexchange.revisions;
Get all revisions identified by a set of ids.
// ids will be available from posts_id endpoint, can be single or multiple seperated by comma.
let ids = "BCF73AEC-7F9D-4623-8C38-66E481B52513"
// using info endpoint
stack_revisions.revisions( ids , revisions_options, (response) => {
// response will be json
console.log(response);
});
To use events endpoint you need to have access_token and key, you can generate your access_token and key here.
let event_options = {
"site": "stackoverflow",
"key": "your_key",
"access_token": "your_token"
}
// ; events object
const stack_events = stackexchange.events;
Get recent events that have occurred on the site. Effectively a stream of new users and content. auth required
// using info endpoint
stack_events.events(event_options, (response) => {
// response will be json
console.log(response);
});
The module exposes following endpoints of stackexchange api:
Endpoints | Description | See in StackExchange |
---|---|---|
users | Get all users on the site. | users |
users_by_ids | Get the users identified by a set of ids. | users/{ids} |
answers_on_users | Get the answers posted by the users identified by a set of ids. | users/{ids}/answers |
badges_on_users | Get the badges earned by the users identified by a set of ids. | users/{ids}/badges |
comments_on_users | Get the comments posted by the users identified by a set of ids. | users/{ids}/comments |
comments_by_users_to_user | Get the comments posted by a set of users in reply to another user. | /users/{ids}/comments/{toid} |
favorites_on_users | Get the questions favorited by users identified by a set of ids. | users/{ids}/favorites |
mentions_on_users | Get the comments that mention one of the users identified by a set of ids. | users/{ids}/mentioned |
users_network_activity | Gets a user's activity across the Stack Exchange network. | users/{id}/network-activity |
user_notifications | Get a user's notifications. | users/{id}/notifications |
user_unread_notifications | Get a user's unread notifications. | users/{id}/notifications/unread |
posts_on_users | Get all posts (questions and answers) owned by a set of users. | users/{ids}/posts |
privileges_on_users | Get the privileges the given user has on the site. | users/{id}/privileges |
questions_on_users | Get the questions asked by the users identified by a set of ids. | users/{ids}/questions |
featured_questions_on_users | Get the questions on which a set of users, have active bounties. | users/{ids}/questions/featured |
no_answer_questions_on_users | Get the questions asked by a set of users, which have no answers. | users/{ids}/questions/no-answers |
unaccepted_questions_on_users | Get the questions asked by a set of users, which have at least one answer but no accepted answer. | users/{ids}/questions/unaccepted |
unanswered_questions_on_users | Get the questions asked by a set of users, which are not considered to be adequately answered. | users/{ids}/questions/unanswered |
reputation_on_users | Get a subset of the reputation changes experienced by the users identified by a set of ids. | users/{ids}/reputation |
reputation_history | Get a history of a user's reputation, excluding private events. | users/{ids}/reputation-history |
full_reputation_history | Get a full history of a user's reputation. auth required | users/{id}/reputation-history/full |
tags_on_users | Get the tags that the users (identified by a set of ids) have been active in. | users/{ids}/tags |
suggested_edits_on_users | Get the suggested edits provided by users identified by a set of ids. | users/{ids}/suggested-edits |
top_user_answers_in_tags | Get the top answers a user has posted on questions with a set of tags. | users/{id}/tags/{tags}/top-answers |
top_user_questions_in_tags | Get the top questions a user has posted with a set of tags. | users/{id}/tags/{tags}/top-questions |
timeline_on_users | Get a subset of the actions of that have been taken by the users identified by a set of ids. | users/{ids}/timeline |
top_answer_tags_on_users | Get the top tags (by score) a single user has posted answers in. | users/{id}/top-answer-tags |
top_tags_on_users | Get the top tags (by score) a single user has posted in. | users/{id}/top-tags |
top_question_tags_on_users | Get the top tags (by score) a single user has asked questions in. | users/{id}/top-question-tags |
moderators | Get the users who have moderation powers on the site. | users/moderators |
elected_moderators | Get the users who are active moderators who have also won a moderator election. | users/moderators/elected |
user_inbox | Get a user's inbox. auth required | users/{id}/inbox |
user_unread_inbox | Get the unread items in a user's inbox. auth required | users/{id}/inbox/unread |
associated_users | Get a user's associated accounts. | users/{ids}/associated |
merge_history | Get the merges a user's accounts has undergone. | users/{ids}/merges |
Endpoints | Description | See in StackExchange |
---|---|---|
me | Get the users identified by a set of ids. | me |
me_answers | Get the answers posted by the users identified by a set of ids. | me/answers |
me_badges | Get the badges earned by the users identified by a set of ids. | me/badges |
me_comments | Get the comments posted by the users identified by a set of ids. | me/comments |
me_comments_to | Get the comments posted by a set of users in reply to another user. | me/comments/{toId} |
me_favorites | Get the questions favorited by users identified by a set of ids. | me/favorites |
me_mentioned | Get the comments that mention one of the users identified by a set of ids. | me/mentioned |
me_network_activity | Gets a user's activity across the Stack Exchange network. | me/network-activity |
me_notifications | Get a user's notifications. | me/notifications |
me_unread_notifications | Get a user's unread notifications. | me/notifications/unread |
me_posts | Get all posts (questions and answers) owned by a set of users. | me/posts |
me_privileges | Get the privileges the given user has on the site. | me/privileges |
me_questions | Get the questions asked by the users identified by a set of ids. | me/questions |
me_featured_questions | Get the questions on which a set of users, have active bounties. | me/questions/featured |
me_no_answer_questions | Get the questions asked by a set of users, which have no answers. | me/questions/no-answers |
me_unaccepted_questions | Get the questions asked by a set of users, which have at least one answer but no accepted answer. | me/questions/unaccepted |
me_unanswered_questions | Get the questions asked by a set of users, which are not considered to be adequately answered. | me/questions/unanswered |
me_reputation | Get a subset of the reputation changes experienced by the users identified by a set of ids. | me/reputation |
me_reputation_history | Get a history of a user's reputation, excluding private events. | me/reputation-history |
me_full_reputation_history | Get a full history of a user's reputation. auth required | me/reputation-history/full |
me_suggested_edits | Get the suggested edits provided by users identified by a set of ids. | me/suggested-edits |
me_tags | Get the tags that the users (identified by a set of ids) have been active in. | me/tags |
me_tags_top_questions | Get the top answers a user has posted on questions with a set of tags. | me/tags/{tags}/top-answers |
me_tags_top_answers | Get the top questions a user has posted with a set of tags. | me/tags/{tags}/top-questions |
me_timeline | Get a subset of the actions of that have been taken by the users identified by a set of ids. | me/timeline |
me_top_answer_tags | Get the top tags (by score) a single user has posted answers in. | me/top-answer-tags |
me_top_question_tags | Get the top tags (by score) a single user has asked questions in. | me/top-question-tags |
me_top_tags | Get the top tags (by score) a single user has posted in. | me/top-tags |
me_inbox | Get a user's inbox. auth required | me/inbox |
me_unread_inbox | Get the unread items in a user's inbox. auth required | me/inbox/unread |
me_associated_users | Get a user's associated accounts. | me/associated |
me_merge_history | Get the merges a user's accounts has undergone. | me/merges |
Endpoints | Description | See in StackExchange |
---|---|---|
questions | Get all questions on the site. | questions |
quetions_by_id | Get the questions identified by a set of ids. | questions/{ids} |
answers_on_questions | Get the answers to the questions identified by a set of ids. | questions/{ids}/answers |
render_answers | Renders a hypothetical answer to a question. This is a post endpoints, the options section looks like this, both fields are required. | questions/{id}/answers/render |
linked_questions | Get the questions that link to the questions identified by a set of ids. | questions/{ids}/linked |
related_questions | Get the questions that are related to the questions identified by a set of ids. | questions/{ids}/related |
questions_timeline | Get the timelines of the questions identified by a set of ids. | questions/{ids}/timeline |
featured_questions | Get all questions on the site with active bounties. | questions/featured |
no-answer-questions | Get all questions on the site with no answers. | questions/no-answers |
unanswered_questions | Get all questions the site considers unanswered. | questions/unanswered |
unanswered_questions_my_tags | Get questions the site considers unanswered within a user's favorite or interesting tags. auth required. | questions/unanswered/my-tags |
question_flag_options | Returns valid flag options for the given question. auth required. | questions/{id}/flags/options |
question_close_options | Returns valid flag options which are also close reasons for the given question. auth required. | questions/{id}/close/options |
comments_on_questions | Get the comments on the questions identified by a set of ids. This endpoint required access_token and key in options. | questions/{ids}/comments |
Endpoints | Description | See in StackExchange |
---|---|---|
answers | Get all answers on the site. | answers |
answers_by_ids | Get answers identified by a set of ids. | answers/{ids} |
accept_answer | Casts an accept vote on the given answer. auth required | answers/{id}/accept |
comments_on_answers | Undoes an accept vote on the given answer. auth required | answers/{id}/accept/undo |
undo_accept_answer | Get comments on the answers identified by a set of ids. | answers/{ids}/comments |
Endpoints | Description | See in StackExchange |
---|---|---|
badges | Get all badges on the site, in alphabetical order. | badges |
badges_by_id | Get the badges identified by ids. | badges/{ids} |
badges_by_name | Get all non-tagged-based badges in alphabetical order. | badges/name |
badge_recipients | Get badges recently awarded on the site. | badges/recipients |
badge_recipients_by_id | Get the recent recipients of the given badges. | badges/{ids}/recipients |
badge_by_tags | Get all tagged-based badges in alphabetical order. | badges/tags |
Endpoints | Description | See in StackExchange |
---|---|---|
tags | Get the tags on the site. | tags |
tags_by_name | Get tags on the site by their names. | tags/{tags}/info |
moderator_only_tags | Get the tags on the site that only moderators can use. | tags/moderator-only |
require_tags | Get the tags on the site that fulfill required tag constraints. | tags/required |
tag_synonyms | Get all the tag synonyms on the site. | tags/synonyms |
faqs_by_tags | Get frequently asked questions in a set of tags. | tags/{tags}/faq |
related_tags | Get related tags, based on common tag pairings. | tags/{tags}/related |
synonyms_by_tags | Get the synonyms for a specific set of tags. | tags/{tags}/synonyms |
top_answerers_on_tags | Get the top answer posters in a specific tag, either in the last month or for all time. | tags/{tag}/top-answerers/{period} |
top_askers_on_tags | Get the top question askers in a specific tag, either in the last month or for all time. | tags/{tag}/top-askers/{period} |
wikis_by_tags | Get the wiki entries for a set of tags. | tags/{tags}/wikis |
Endpoints | Description | See in StackExchange |
---|---|---|
comments | Get all comments on the site. | comments |
comments_by_ids | Get comments identified by a set of ids. | comments/{ids} |
delete_comment | Delete a comment identified by its id. auth required | comments/{id}/delete |
edit_comment | Edit a comment identified by its id. auth required | comments/{id}/edit |
create_comment_flag | Casts a flag on the given comment. auth required | comments/{id}/flags/add |
comment_flag_options | Returns valid flag options for the given comment. auth required | comments/{id}/flags/options |
upvote_comment | Casts an upvote on the given comment. auth required | comments/{id}/upvote |
undo_upvote_comment | Undoes an upvote on the given comment. auth required | comments/{id}/upvote/undo |
Endpoints | Description | See in StackExchange |
---|---|---|
posts | Get all posts (questions and answers) in the system. | posts |
posts_by_ids | Get all posts identified by a set of ids. Useful for when the type of post (question or answer) is not known. | posts/{ids} |
comments_on_posts | Get comments on the posts (question or answer) identified by a set of ids. | posts/{ids}/comments |
create_comment | Create a new comment on the post identified by id. auth required | posts/{id}/comments/add |
render_comment | Renders a hypothetical comment on the given post. | posts/{id}/comments/render |
revisions_by_ids | Get revisions on the set of posts in ids. | posts/{ids}/revisions |
posts_on_suggested_edits | Get suggested edits on the set of posts in ids. | posts/{ids}/suggested-edits |
Endpoints | Description | See in StackExchange |
---|---|---|
search | Search the site for questions meeting certain criteria. | search |
advanced_search | Search the site for questions using most of the on-site search options. | search/advanced |
similar | Search the site based on similarity to a title. | similar |
excerpt_search | Searches a site. | search/excerpts |
Endpoints | Description | See in StackExchange |
---|---|---|
suggested_edits | Get all the suggested edits on the site. | suggested-edits |
suggested_edits_by_ids | Get the suggested edits identified by a set of ids. | suggested-edits/{ids} |
Endpoints | Description | See in StackExchange |
---|---|---|
invalidate_access_tokens | Allows an application to dispose of access_tokens when it is done with them. | access-tokens/{accessTokens}/invalidate |
read_access_tokens | Allows an application to inspect access_tokens it has, useful for debugging. | access-tokens/{accessTokens} |
application_de_authenticate | Allows an application to de-authorize itself for a set of users. | apps/{accessTokens}/de-authenticate |
errors | Get descriptions of all the errors that the API could return. | errors |
simulate_errors | Simulate an API error for testing purposes. | errors/{id} |
create_filter | Create a new filter. | filters/create |
read_filter | Decode a set of filters, useful for debugging purposes. | filters/{filters} |
Inbox | Get a user's inbox, outside of the context of a site. auth required | inbox |
inbox_unread | Get the unread items in a user's inbox, outside of the context of a site. auth required | inbox/unread |
notifications | Get a user's notifications, outside of the context of a site. auth required | notifications |
unread_notifications | Get a user's unread notifications, outside of the context of a site. auth required | notifications/unread |
sites | Get all the sites in the Stack Exchange network. | sites |
Endpoints | Description | See in StackExchange |
---|---|---|
info | Get information about the entire site. | info |
Endpoints | Description | See in StackExchange |
---|---|---|
privileges | Get all the privileges available on the site. | privileges |
Endpoints | Description | See in StackExchange |
---|---|---|
revisions | Get all revisions identified by a set of ids. | revisions/{ids} |
Endpoints | Description | See in StackExchange |
---|---|---|
events | Get recent events that have occurred on the site. Effectively a stream of new users and content. auth required | events |