35

Updates (October 6th, 2025): We've closed applications to join the beta

Due to a high number of applicants and participants, we've closed our submissions form. Thanks for your interest and feedback!

Update (September 30, 2025): The API v3 limited beta has begun!

The banner announcing availability of applications for API v3. It is shown network wide, and reads "Shape the future of the Stack Exchange API - get early access to what's new!"

The API v3 beta has begun! We're excited for your feedback!


TLDR

  • Stack Exchange API version 3 is being expanded to include the public platform. API version 2.x will eventually be deprecated, but not anytime soon.

  • There is an upcoming limited beta release for v3, which community members were able to apply to participate in, but we've since closed invitations while we process them.

This post will be of interest to anyone who builds or uses applications that leverage the Stack Exchange API. The current version of the public API is version 2, with most users using version 2.3. Version 3 of the Stack Exchange API has, up to this point, been exclusively used for the Stack Overflow for Teams product. We are expanding version 3 to support content from the public platform. We’ll be posting more details about v3 in the coming months.

Please note: While we do expect to eventually deprecate API version 2, there is no active planning for that yet, and there is no fixed timeline we’re working under.

What’s happening next?

We're launching a limited beta release of API version 3. We want to work with users who will be both creating new apps for v3 and adapting existing apps for v3. The beta group’s experiences and feedback will inform creation of migration guides and updated support materials. An open beta release will follow the limited beta.

Interested users can apply to be part of the limited beta via this form.

While not yet available for public use, documentation for version 3 is available to view at https://api.stackexchange.com/v3/swagger/index.html

Swagger documents (or possibly YAML-driven docs) will be the new primary source of documentation of the API. One change you’ll note when looking at the documentation is that /posts is no more, it’s now /questions and /answers. Endpoints will allow for return of all answers related to a question. Please note that the new version is in active development and there may be additions and large changes to the routes and functionality.

What’s changed recently?

To lay the groundwork for version 3 becoming available, areas of Stack Apps related to app registration and management are being updated. These changes will be visible to all users. This is a visual refresh and also makes some new functionality available.

It’s important to note that nothing changes about existing applications’ configuration or operability as a result of these updates. The only impactful change may be that the full API key is no longer displayed in the user interface, in alignment with security best practices.

The changes are detailed below, followed by screenshots. Some aspects of the updates are to the layout and design, and others make new functionality available.

  • The “Get Started” right sidebar module on Stack Apps is updated with a button layout (figure a, right side)

  • A link to the Your Apps page (where a user sees a list of their existing API apps) is added to the left navigation on Stack Apps (figure a, left side)

  • The app registration page gets an updated layout (figure b)

  • The Your Apps page gets an updated layout (figure c)

  • The application’s dashboard page (figure d) gets a substantially updated layout, and also includes new functionality:

    • A dismissible onboarding modal at the top of the page; the standard page header includes some of the same helpful links

    • NEW: A section to create and manage multiple API keys per app, with the ability to rotate/regenerate keys as needed.

      • Please note that the full key is no longer be displayed on this page; existing app owners should securely store keys elsewhere

      • For newly created apps, keys and client secrets are not issued by default and can be generated and rotated here (figure e)

  • NEW: The OAuth management area (figure f) now offers multiple grant options; there is a notice that implicit grant is no longer advisable, with “authorization code with PKCE” as the new and recommended option.

Two different images in a single image file, shown side by side. The left image shows the updated Stack Apps left side navigation with some items in a different order and the addition of the Your Apps item. The right image shows an updated right sidebar module for Stack Apps, with buttons replacing the links that were used in the old version Figure a - The updated left navigation and right sidebar module on Stack Apps

The updated registration page which is a cleaner and more modern design offering the same functionality as the older page Figure b - The updated registration page for new apps

The updated Your Apps page which displays all of a user's apps in a table, with columns for application name, application URL, application status, and the number of authenticated users of the app Figure c - The Your Apps page

The updated application dashboard page, with new functionality shown such as a table for displaying multiple keys Figure d - The updated application dashboard page

The modal seen when a user generates a new API key, which includes a copy function Figure e - New key generation

The updated OAuth management modal, with new functionality shown such as the new grant option for Authorization using PKCE, which is noted as the recommended option, and a note of security caution that is displayed if the implicit grant option is selected Figure f - OAuth management modal

These changes were released on Tuesday, June 10 2025.

Help documentation about the OAuth updates is available at https://stackapps.com/help/api-authentication

For bug reports related to the new dashboard, please create a new Stack Apps post with the bug tag. For dashboard feature requests, use the feature-request tag.

9
  • 1
    With this new version, would we be able to develop apps that need an API key and/or write access without needing to create "Placeholder" questions"? Also, do you have any plans to support a chat API? Commented Jun 5, 2025 at 17:39
  • 8
    IIUC the v3 API doesn't have way to include answers when you're querying for questions (i.e. there's no way to return answers for multiple questions at once). This could mean a lot of additional requests for bots that are trying to review the latest activity on site in full context. Similarly you can't even fetch all of the comments on a question with one request, you need separate requests for each post. Although the new API interface is more conventional, this is a big loss in flexibility and efficiency for clients, and I have to wonder if it could have been intentional, to limit scraping. Commented Jun 5, 2025 at 18:22
  • 6
    Please, please, please include a method to mark inbox items as read in the new version of the api. Commented Jun 5, 2025 at 19:34
  • 5
    @Starship At this time we require a post in order to claim write access for keys (though not required solely to get a key) and there are not plans to change that. Changes to claim scopes are a possibility though. Regarding a chat API, there is certainly interest in that but no specific plans. Chat is somewhat resurgent now as a focus, so it's a good time to be asking. Commented Jun 5, 2025 at 23:45
  • 2
    @Jeremy There is an endpoint to retrieve all comments on a question. But it sounds like you're wanting the comments from the question's answers as well, in the same request? More generally, regarding your initial question, there's lots in the backlog still to be done and released, including endpoints to facilitate moderation and curation needs. The new version is in active development, with iterative updates, so please don't see anything seemingly "missing" as an intentional exclusion. If things still seem missing when we get to the beta, we want to hear about it. Commented Jun 5, 2025 at 23:55
  • 2
    @samcarter_is_at_topanswers.xyz Feature request noted. But let's keep this post focused on the new changes released next week! Commented Jun 6, 2025 at 0:27
  • For those of us who started experimenting earlier on, do we need to reapply for the Beta? Commented Sep 30, 2025 at 20:10
  • 2
    @ThomasWard no need to reapply. Your access continues, watch for email and inbox notifications. Commented Oct 1, 2025 at 17:24
  • 1
    where I can see the API specs? Commented Oct 3, 2025 at 1:15

2 Answers 2

12

The new API is simpler and more conventional, which are nice properties to have. However the flexibility of the old API (and its "filter" system) was really powerful and made a lot of things easier and more efficient for users. I imagine it could sometimes have been irritating and complicated to support, but losing it would be a big step backwards. Here's a simple example of how I used it.

I sometimes like to save complete copies of a threads, with all of their answers and comments and such, to make sure I have a copy indexed and can find all of the information in the future. Typically to do this, I would grab the entire JSON API response for the question page, save it as POST_ID.json, then run it through an HTML template and save that alongside it as POST_ID.html, so I have it in a human-readable format but I still have the original full-fidelity data in case I want to update my template to include more details, or it had a bug or something.

For a specific example, consider Stack Overflow question 14952052: Convert blob URL to normal URL. With the current API, by defining the right filter I can get all of this information in a single request:

curl -o 14952052.json 'https://api.stackexchange.com/2.3/questions/14952052?order=desc&sort=activity&site=stackoverflow&filter=1x03bKxqqJ1t(qO_3rc0107HAS7gTDcx1bXQBo'
{
  "items": [
    {
      "tags": [...],
      "comments": [...],
      "answers": [
        {
          "comments": [
            {
              "owner": {
                "badge_counts": {...},
                "account_id": 420975,
                "reputation": 1290,
                "user_id": 798955,
                "user_type": "registered",
                "accept_rate": 90,
                "profile_image": "https://www.gravatar.com/avatar/0b145a77e0aaa86fbb591f5c639c42a4?s=256&d=identicon&r=PG",
                "display_name": "bhh1988",
                "link": "https://stackoverflow.com/users/798955/bhh1988"
              },
              "edited": false,
              "score": 27,
              "creation_date": 1409759592,
              "post_id": 16179887,
              "comment_id": 40077159,
              "content_license": "CC BY-SA 3.0",
              "body_markdown": "If blob urls don't point to server data, then how come Youtube videos' src url look like:\n\nsrc=\"blob:https%3A//www.youtube.com/44f26667-03f1-4978-9eed-af0cbf11dd67\"\n\n(in Chrome)",
              "body": "If blob urls don't point to server data, then how come Youtube videos' src url look like:  src="blob:https%3A//www.youtube.com/44f26667-03f1-4978-9eed-‌​af0cbf11dd67"  (in Chrome)"
            },
         ...

I haven't used the new API yet, but I'm trying to estimate what would be required based on the docs.

(These auto-generated docs, by the way, are not good: it defines a bunch of response types at the bottom, but the methods don't explicitly indicate which response types they return. I can infer it, but the existing docs are clearer about this. The only comment response type is "paginated comments", but there are no pagination parameters accepted by the question comments method, so is it paginated or not?)

I believe that instead of having a terminal one-line to grab the data, I'd need a script that would end up making requests for...

# the question itself:
- https://api.stackexchange.com/v3/stackoverflow/questions/14952052
# the comments on the question:
- https://api.stackexchange.com/v3/stackoverflow/questions/14952052/comments
# (possibly more requests if required by pagination, docs unclear)
# the answers on the question:
- https://api.stackexchange.com/v3/stackoverflow/questions/14952052/answers
# (potentially more requests if required by pagination)
# a request for the comments on every answer individually
- https://api.stackexchange.com/v3/stackoverflow/questions/14952052/answer/16179887/comments
- https://api.stackexchange.com/v3/stackoverflow/questions/14952052/answer/31581117/comments
- https://api.stackexchange.com/v3/stackoverflow/questions/14952052/answer/57141467/comments
- https://api.stackexchange.com/v3/stackoverflow/questions/14952052/answer/64857135/comments
- https://api.stackexchange.com/v3/stackoverflow/questions/14952052/answer/67080855/comments
- https://api.stackexchange.com/v3/stackoverflow/questions/14952052/answer/70918690/comments
- https://api.stackexchange.com/v3/stackoverflow/questions/14952052/answer/50303373/comments
# (and possibly more requests if required by pagination, docs unclear)

This is way more effort, way less efficient, and this still misses a ton of the metadata that's present in the old API.

Given the reality that the community has fled the site, it's obvious that the semi-engaged users remaining will not be updating all of the community tools and user scripts to use the new API (particularly when a replacing a single API request could require more code than some entire browser extensions already have). Community tooling is going to break and never recover.

Obviously they're not the target audience, and this way of defining an API is probably a bit easier for corporate users who can afford to spend more time and resources on integrations. For your business goals, this might be reasonable. But this is clearly another reflection of the company's lack of awareness or concern for the existing community and what has been built up over the site's lifetime. If you were just moving future development to the new API, that would be one thing, but if entirely dropping support for the new one, the only way folks will feel about that is upset.

(I don't think this was a primary motivation (the business case for this change is already clear enough), but I need to mention that this obviously makes it a lot harder for folks to scrape the site through the API, and that might could been a bonus for some folks making these decisions, without considering the impact on legitimate uses.)


Aside: I'm glad the new API doesn't HTML-escape by default. That was still a questionable choice when the API was new, but it was at least arguably, while today it seems very silly. Dropping accept_rate is also probably long-overdue — in this test I was surprised to see that it was still returning a meaningful value in the old API, instead of just a placeholder 0.

1
  • 4
    This is insightful commentary and good call-outs. Moving away from filters and the Post concept are big changes and there is still work to be done. We received some excellent feedback on an earlier state of v3 that mods saw last year which represented some of your concerns very well. I'll reiterate that the new version is in active development, with iterative updates, so please don't see anything seemingly "missing" as an intentional exclusion. If things still seem missing when we get to the beta, we want to hear about it. Commented Jun 9, 2025 at 16:00
8

Licensing

The API does not appear to return any licensing information. I would expect that each Question, Answer, and Comment would be clearly and unambiguously marked with the license. I would expect it to be named ("CC BY-SA 4.0" or perhaps the SPDX identifier "CC-BY-SA-4.0") and use the Creative Commons Canonical URL (https://creativecommons.org/licenses/by-sa/4.0/) to ensure that recipients understand the terms of using the data.

Under the terms of CC BY-SA 4.0, attribution requires a notice that refers to the public license (Section 3(a)(1)(A)(iii)). Because this is not included, Section 6(a) is triggered and SE's rights terminate automatically. If not resolved in 30 days (as defined in Section 6(b)(1)), the right to use the material is terminated until express reinstatement (Section 6(b)(2)). Earlier versions of the license, such as 2.5 and 3.0, don't have the 30-day period to resolve issues (see also: the summary of changes in the 4.0 CC licenses).

To me, this is a huge showstopper for a beta. User-contributed content is going to be available to a broader audience without the appropriate licensing information, which is a violation of the CC licenses. I believe that this is crucial to resolve before expanding the beta.

Revisions

We're now getting closer to the beta, and there's some feedback from the moderator preview (staff/mod only link) that remains unresolved. Since it's still missing close to the beta, you're hearing about it.

The way you access revisions in this API needs some attention. Working with revisions is painful, whether it's through the data dump, SEDE, or this API. Since the data dump and SEDE are based on the database schema, I wouldn't necessarily expect them to change. But some of the problems can be massaged out in the API to make it more user-friendly.

The issue is that to get a post (especially a question, which has a title, a body, and tags) at a particular point in time, you need to walk the history of the post. In the definition of Question revision, if a revision only changed the body, lastBodyMarkdown and bodyMarkdown would be populated, but the lastTags, tags, lastTitle, and title fields would be null. So one would need to go to the previous revision, potentially all the way back to the original post, to get the state of a post at a particular point in time.

I see a few possible implementations:

  1. Add a parameter to the revision endpoints (or perhaps the question and answer endpoints) that allows for specifying a date. If the post existed at that date, return all of the fields as they were at that particular date and time. If the post did not exist, return nulls.
  2. Each Question revision or Answer revision should contain all of the fields. If a field was not modified, both lastX and X would have the same value. For example, if a revision modified the question title, the lastTitle would have the previous revision's title and title would have the revision's title. At the same time lastTags and tags would contain the same values, indicating the field hasn't changed.
  3. Instead of sending the previous and current values, send the current revision's fields along with a boolean to indicate if it has changed since the previous revision. For example, if a revision modified the body, the revision object would contain a body that is the post-edit body and a boolean bodyModified of true. If someone wanted to do a comparison, they could then get the previous revision and compare the body.

Web URL, Share Link, and Attribution Link

What is the difference between the webUrl, shareLink and attributionLink? The examples for both questions and answers show an example that is the same for all three fields. Perhaps this is a documentation issue, but I would want to understand the differences in Swagger docs better.

4
  • 1
    Regarding licensing, this may be ready by the time the limited beta starts, or if not, then shortly after (and well before the open beta stage). You’ll be able to give feedback on the specifics during the beta! Commented Sep 26, 2025 at 16:02
  • 1
    Regarding revisions, we agree that they are hard to work with, and this is one area where we hope to ideate more with the beta group. We encourage you to present these options for discussion in the beta conversations once things kick off. Commented Sep 26, 2025 at 16:02
  • 1
    Regarding the links: webUrl is a direct link to the resource on the appropriate SE site. shareLink is a trackable link that matches the link generated by the Share button for a post. attributionLink is currently the same as shareLink, but will be getting updated to use a separate trackable link, that should have a preview link that would work for embedding and attributing in other pages Commented Sep 26, 2025 at 16:03
  • 1
    @Frog I applied to join the beta. I don't have an app yet, but I have an idea for one that requires reasonable access to revisions. Regarding licensing, though, given the legal ramifications, I hope that it is done before even the limited beta. Exposing someone's content without meeting the terms of the license starts a 30-day timer. If it isn't rectified within 30 days of the beta starting, the SE can start to lose access to share contributions under the CC BY SA license. Commented Sep 26, 2025 at 16:14

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.