2

I want to use api.stackexchange.com to get duplicate questions.

Scenario:

  • I get a question from api.stackexchange.com using GET .../questions/{my_question_id}.
  • In the next step I would like to get a list of ids that refer to duplicate question of my_question_id.

Is there any API that allows this?

  • 1
    Can you try the linked questions api, in the result set, which are having the "closed_reason": "duplicate" are the duplicate questions to the given question id. – Arulkumar Apr 5 at 10:20
1

It's possible with the linked questions API call, but you'll need to do some work to filter out the real duplicates (as opposed to question which are merely linked by mentioning the original question in posts or comments).

The default filter includes a closed_reason which will have the value duplicate, but it could be that it's closed as duplicate of another question. Therefore, you need to add the closed_details to the filter:

enter image description here

and check the original_questions element. For example, to find the many duplicates of Editing a post during review doesn't show an "edit not possible" message you can call the following URL: https://api.stackexchange.com/2.2/questions/298797/linked?order=desc&sort=activity&site=meta&filter=!9Z(-wvHE( and look for its question_id, 298797.

enter image description here

You must log in to answer this question.

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