3

Version 2.3 of the SE API does not clearly distinguish between questions that are on Stack Overflow's Staging Ground and questions on its main site. This comment on a SmokeDetector GH issue details it pretty completely, but to recap, GET requests for SG questions currently look something like this:

"items": [
  {
    "score": 0,
    "creation_date": 1725590314,
    "post_type": "question",
    "post_id": 78955432,
    "share_link": "https://stackoverflow.com/q/78955432",
    "link": "https://stackoverflow.com/q/78955432"
  }
],

This is nearly identical to the regular report for questions, which makes it difficult to tell whether a post is an actual question or not.

How can I access information about a post's Staging Ground status via the API?

1 Answer 1

3

The SE API already distinguishes Staging Ground questions from public questions. In the 2.4 version of the SE API, which is the version you need to use in order to deal with the Staging Ground, both the question object and post object have the post_state field, which can have any of the following values:

  • Published (all public questions),
  • PublishedAndStagingGround,
  • StagingGround_New,
  • StagingGround_Reeval,
  • StagingGround_MinorEdit,
  • StagingGround_MajorChanges,
  • StagingGround_Graduated,
  • StagingGround_OffTopic,
  • StagingGround_Duplicate.

I haven't actually tested this to see which values are actually returned, but it appears that the clear intent of that field is to provide the information needed to distinguish between public and Staging Ground questions.

3
  • Wow, that's incredibly confusing. You'd think that the latest version of the API would be the one that is featured most prominently on the website. But that still says that 2.3 is the latest version. In fact, I can't find any way to show the documentation for v2.4 (other than clicking your links, which have a query string to request this version). How would someone find that from the SE API website? Why is this so hidden? Is not intended for general use yet?
    – Cody Gray
    Commented Sep 10 at 15:58
  • 1
    @CodyGray As I understand, version 2.4 was primarily released to allow access to the Staging Ground (SG) and to differentiate SG questions within the SE API. It was created somewhat prior to the Staging Ground going into Beta.I was specifically informed about it, and given direct links to the SE API ?version=2.4 pages by SE developers in chat in order to make sure that SmokeDetector could access SG questions when SG entered beta. The code to do that was merged on 2022-12-08. Given that it's, obviously, public and the SG is fully released, I'm assuming it's available for general use.
    – Makyen
    Commented Sep 12 at 18:05
  • As to finding it on the SE API website: I'm unaware of any links on the site that allow you to pick the version of the SE API, even though pages using the version=N.N parameter exist for other versions. Why those links don't exist, is likely to be the normal answer for most such things: nobody thought to put them in. As to why 2.3 remains the default: I assume that SE initially released it as Beta, with the intent that there would be limited use, and just hasn't gotten around to, or forgotten to, change it to use 2.4 as default now that the Staging Ground is fully released.
    – Makyen
    Commented Sep 12 at 18:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .