通过 /questions? 仅从 Stack Exchange api 获取已关闭的问题?

Get only closed questions from the Stack Exchange api, via /questions?

我只想从 Stack Exchange API 的 /questions 获取封闭式问题。

我对过滤器进行了一些尝试,并且something which gives我为每个问题提出了一些JSON这样的问题:

{
      "tags": [
        "c++",
        "opencl",
        "intel"
      ],
      "close_vote_count": 0,
      "title": "Weird OpenCL calls side effect on C++ for loop performance",
      "body": "<p>I'm working on a C++ project using OpenCL. I'm using the CPU as an OpenCL device with the  <a href=\"http://registrationcenter.intel.com/irc_nas/5193/intel_code_builder_for_opencl_2015_ubuntu_5.0.0.43_x64.tgz\" rel=\"nofollow\">intel OpenCL runtime</a></p>[...]"
    },

现在,我只想要已关闭的问题。

我该怎么做?

(另一件事:我怎么能 从结果中排除 已关闭的问题?)

您可以使用以下查询轻松完成此操作:

SELECT count(*)
FROM Posts
WHERE ClosedDate IS NOT NULL

然而,这并没有告诉您关闭的原因,要获得此信息,您应该查看 PostHistoryTable,其中包含与 post.[=12= 相关的所有更改的详细信息。 ]