# StackExchange API

> Q&A forum for developers.

StackExchange is a development API from stackexchange.com. Requests are authenticated with OAuth. It is served over HTTPS. Its OpenAPI description documents 124 endpoints.

## At a glance

- Category: [Development](https://www.openparable.com/apis/category/development)
- Provider: stackexchange.com
- Authentication: OAuth
- HTTPS: Yes
- CORS: Not stated
- Base URL: https://api.stackexchange.com/2.0
- Documentation: https://api.stackexchange.com/
- OpenAPI description: https://api.apis.guru/v2/specs/stackexchange.com/2.0/openapi.json
- Version: 2.0
- Specification updated: 2021-06-21

## Example request

```bash
curl -X GET "https://api.stackexchange.com/2.0/answers" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

## Endpoints

- `GET /access-tokens/{accessTokens}` — Reads the properties for a set of access tokens.
- `GET /access-tokens/{accessTokens}/invalidate` — Immediately expires the access tokens passed. This method is meant to allow an application to discard any active access tokens it no longer needs.
- `GET /answers` — Returns all the undeleted answers in the system.
- `GET /answers/{ids}` — Gets the set of answers identified by ids.
- `GET /answers/{ids}/comments` — Gets the comments on a set of answers.
- `GET /apps/{accessTokens}/de-authenticate` — Passing valid access_tokens to this method causes the application that created them to be de-authorized by the user associated with each access_token. This will
- `GET /badges` — Returns all the badges in the system.
- `GET /badges/name` — Gets all explicitly named badges in the system.
- `GET /badges/recipients` — Returns recently awarded badges in the system.
- `GET /badges/tags` — Returns the badges that are awarded for participation in specific tags.
- `GET /badges/{ids}` — Gets the badges identified in id.
- `GET /badges/{ids}/recipients` — Returns recently awarded badges in the system, constrained to a certain set of badges.
- `GET /comments` — Gets all the comments on the site.
- `GET /comments/{ids}` — Gets the comments identified in id.
- `POST /comments/{id}/delete` — Deletes a comment.
- `POST /comments/{id}/edit` — Edit an existing comment.
- `GET /errors` — Returns the various error codes that can be produced by the API.
- `GET /errors/{id}` — This method allows you to generate an error.
- `GET /events` — Returns a stream of events that have occurred on the site.
- `GET /filters/create` — Creates a new filter given a list of includes, excludes, a base filter, and whether or not this filter should be "unsafe".
- `GET /filters/{filters}` — Returns the fields included by the given filters, and the "safeness" of those filters.
- `GET /inbox` — Returns a user's inbox.
- `GET /inbox/unread` — Returns the unread items in a user's inbox.
- `GET /info` — Returns a collection of statistics about the site.
- `GET /me` — Returns the user associated with the passed access_token.
- `GET /me/answers` — Returns the answers owned by the user associated with the given access_token.
- `GET /me/associated` — Returns all of a user's associated accounts, given an access_token for them.
- `GET /me/badges` — Returns the badges earned by the user associated with the given access_token.
- `GET /me/comments` — Returns the comments owned by the user associated with the given access_token.
- `GET /me/comments/{toId}` — Returns the comments owned by the user associated with the given access_token that are in reply to the user identified by {toId}.
- `GET /me/favorites` — Returns the questions favorites by the user associated with the given access_token.
- `GET /me/inbox` — Returns the user identified by access_token's inbox.
- `GET /me/inbox/unread` — Returns the unread items in the user identified by access_token's inbox.
- `GET /me/mentioned` — Returns the comments mentioning the user associated with the given access_token.
- `GET /me/merges` — Returns a record of merges that have occurred involving a user identified by an access_token.
- `GET /me/notifications` — Returns a user's notifications, given an access_token.
- `GET /me/notifications/unread` — Returns a user's unread notifications, given an access_token.
- `GET /me/privileges` — Returns the privileges the user identified by access_token has.
- `GET /me/questions` — Returns the questions owned by the user associated with the given access_token.
- `GET /me/questions/featured` — Returns the questions that have active bounties offered by the user associated with the given access_token.
- `GET /me/questions/no-answers` — Returns the questions owned by the user associated with the given access_token that have no answers.
- `GET /me/questions/unaccepted` — Returns the questions owned by the user associated with the given access_token that have no accepted answer.
- `GET /me/questions/unanswered` — Returns the questions owned by the user associated with the given access_token that are not considered answered.
- `GET /me/reputation` — Returns the reputation changed for the user associated with the given access_token.
- `GET /me/reputation-history` — Returns user's public reputation history.
- `GET /me/reputation-history/full` — Returns user's full reputation history, including private events.
- `GET /me/suggested-edits` — Returns the suggested edits the user identified by access_token has submitted.
- `GET /me/tags` — Returns the tags the user identified by the access_token passed is active in.
- `GET /me/tags/{tags}/top-answers` — Returns the top 30 answers the user associated with the given access_token has posted in response to questions with the given tags.
- `GET /me/tags/{tags}/top-questions` — Returns the top 30 questions the user associated with the given access_token has posted in response to questions with the given tags.
- `GET /me/timeline` — Returns a subset of the actions the user identified by the passed access_token has taken on the site.
- `GET /me/top-answer-tags` — Returns the user identified by access_token's top 30 tags by answer score.
- `GET /me/top-question-tags` — Returns the user identified by access_token's top 30 tags by question score.
- `GET /me/write-permissions` — Returns the write permissions a user has via the api, given an access token.
- `GET /notifications` — Returns a user's notifications.
- `GET /notifications/unread` — Returns a user's unread notifications.
- `GET /posts` — Fetches all posts (questions and answers) on the site.
- `GET /posts/{ids}` — Fetches a set of posts by ids.
- `GET /posts/{ids}/comments` — Gets the comments on the posts identified in ids, regardless of the type of the posts.
- `GET /posts/{ids}/revisions` — Returns edit revisions for the posts identified in ids.
- `GET /posts/{ids}/suggested-edits` — Returns suggsted edits on the posts identified in ids.
- `POST /posts/{id}/comments/add` — Create a new comment.
- `GET /privileges` — Returns the earnable privileges on a site.
- `GET /questions` — Gets all the questions on the site.
- `GET /questions/featured` — Returns all the questions with active bounties in the system.
- `GET /questions/no-answers` — Returns questions which have received no answers.
- `GET /questions/unanswered` — Returns questions the site considers to be unanswered.
- `GET /questions/{ids}` — Returns the questions identified in {ids}.
- `GET /questions/{ids}/answers` — Gets the answers to a set of questions identified in id.
- `GET /questions/{ids}/comments` — Gets the comments on a question.
- `GET /questions/{ids}/linked` — Gets questions which link to those questions identified in {ids}.
- `GET /questions/{ids}/related` — Returns questions that the site considers related to those identified in {ids}.
- `GET /questions/{ids}/timeline` — Returns a subset of the events that have happened to the questions identified in id.
- `GET /revisions/{ids}` — Returns edit revisions identified by ids in {ids}.
- `GET /search` — Searches a site for any questions which fit the given criteria.
- `GET /search/advanced` — Searches a site for any questions which fit the given criteria.
- `GET /similar` — Returns questions which are similar to a hypothetical one based on a title and tag combination.
- `GET /sites` — Returns all sites in the network.
- `GET /suggested-edits` — Returns all the suggested edits in the systems.
- `GET /suggested-edits/{ids}` — Returns suggested edits identified in ids.
- `GET /tags` — Returns the tags found on a site.
- `GET /tags/moderator-only` — Returns the tags found on a site that only moderators can use.
- `GET /tags/required` — Returns the tags found on a site that fulfill required tag constraints on questions.
- `GET /tags/synonyms` — Returns all tag synonyms found a site.
- `GET /tags/{tags}/faq` — Returns the frequently asked questions for the given set of tags in {tags}.
- `GET /tags/{tags}/info` — Returns tag objects representing the tags in {tags} found on the site.
- `GET /tags/{tags}/related` — Returns the tags that are most related to those in {tags}.
- `GET /tags/{tags}/synonyms` — Gets all the synonyms that point to the tags identified in {tags}. If you're looking to discover all the tag synonyms on a site, use the /tags/synonyms methods
- `GET /tags/{tags}/wikis` — Returns the wikis that go with the given set of tags in {tags}.
- `GET /tags/{tag}/top-answerers/{period}` — Returns the top 30 answerers active in a single tag, of either all-time or the last 30 days.
- `GET /tags/{tag}/top-askers/{period}` — Returns the top 30 askers active in a single tag, of either all-time or the last 30 days.
- `GET /users` — Returns all users on a site.
- `GET /users/moderators` — Gets those users on a site who can exercise moderation powers.
- `GET /users/moderators/elected` — Returns those users on a site who both have moderator powers, and were actually elected.
- `GET /users/{ids}` — Gets the users identified in ids in {ids}.
- `GET /users/{ids}/answers` — Returns the answers the users in {ids} have posted.
- `GET /users/{ids}/associated` — Returns all of a user's associated accounts, given their account_ids in {ids}.
- `GET /users/{ids}/badges` — Get the badges the users in {ids} have earned.
- `GET /users/{ids}/comments` — Get the comments posted by users in {ids}.
- `GET /users/{ids}/comments/{toid}` — Get the comments that the users in {ids} have posted in reply to the single user identified in {toid}.

## Questions

### Does the StackExchange API need an API key?

Yes. The StackExchange API uses OAuth authentication; the documentation explains how to get credentials.

### Does the StackExchange API support HTTPS?

Yes, the StackExchange API is served over HTTPS.

### How many endpoints does the StackExchange API have?

Its OpenAPI description lists 124 endpoints in version 2.0. The first 100 are shown on this page.

### What are alternatives to the StackExchange API?

Other Development APIs include Cloudflare, Azure DevOps, IPify, App Store Connect API, IPinfo.

## Similar development APIs

- [Cloudflare](https://www.openparable.com/apis/cloudflare): Manage DNS, CDN, Workers and other services; documented with an official OpenAPI 3.0 spec
- [Azure DevOps](https://www.openparable.com/apis/azure-devops): The Azure DevOps basic components of a REST API request/response pair
- [IPify](https://www.openparable.com/apis/ipify): A simple IP Address API
- [App Store Connect API](https://www.openparable.com/apis/app-store-connect): The data structure that represents an app store connect api resource.
- [IPinfo](https://www.openparable.com/apis/ipinfo): Another simple IP Address API
- [IBM Text to Speech](https://www.openparable.com/apis/ibm-text-to-speech): Convert text to speech
- [SiteIntel](https://www.openparable.com/apis/siteintel): Extract metadata, tech stack, emails, and screenshots from any URL
- [DigitalOcean Status](https://www.openparable.com/apis/digitalocean-status): Status of all DigitalOcean services
- [Netlify](https://www.openparable.com/apis/netlify): Netlify is a hosting service for the programmable web
- [Docker Hub](https://www.openparable.com/apis/docker-hub): Interact with Docker Hub
- [MineSkin API](https://www.openparable.com/apis/mineskin): Client implementations: Java: https://github.com/InventivetalentDev/MineskinClient NodeJS: https://github.com/InventivetalentDev/mineskin-client Examples: https://github.com/MineSkin/examples
- [Google Docs](https://www.openparable.com/apis/google-docs): API to read, write, and format Google Docs documents

Listed from: public-apis (MIT), public-apis database (MIT), APIs.guru (CC0). Check the provider's terms before use.

---

Source: https://www.openparable.com/apis/stackexchange (OpenParable). Cite the canonical URL above.
