1

When working with the Stack Exchange API I noticed that there is important data (at least for what I thought to do) not available, whether the question, answer or comment was edited or not:

{
  "items": [
    {
      "tags": [
        "flutter",
        "dart"
      ],
      "owner": {
        "account_id": 4684815,
        "reputation": 4503,
        "user_id": 3792482,
        "user_type": "registered",
        "accept_rate": 43,
        "profile_image": "https://graph.facebook.com/100000271181489/picture?type=large",
        "display_name": "phongyewtong",
        "link": "https://stackoverflow.com/users/3792482/phongyewtong"
      },
      "is_answered": false,
      "view_count": 2,
      "answer_count": 0,
      "score": 0,
      "last_activity_date": 1652287746,
      "creation_date": 1652287746,
      "question_id": 72204805,
      "content_license": "CC BY-SA 4.0",
      "link": "https://stackoverflow.com/questions/72204805/flutter-doughnut-chart-has-hugh-margin-padding-how-to-remove",
      "title": "flutter doughnut chart has hugh margin/padding. how to remove?"
    }

I understand that there is a way to reach this result (I confess that I'm not completely and absolutely sure about that) by taking the value of "creation_date" and seeing if it is equal to "last_activity_date", but to speed up the work of a code, if we had this value already in the API response, it would be perfect.

I think it would be interesting if we had:

"is_edited": false

or

"is_edited": true

Please, if can confirm if "creation_date" == "last_activity_date" gets the same result, that would be an important answer too!

1 Answer 1

2

There is a last_edited_date on questions, answers and posts. If it's empty (and you did include it in your filter), it hasn't been edited.

Comments have a built-in edited field which seems to be what you're looking for.

2
  • In my filter, how should I set last_edit_date it to null so that it only returns questions that have no edit? I confess that in the documentation I could not understand its use. To help, this is my url today: https://api.stackexchange.com/2.3/questions/no-answers?pagesize=30&fromdate={date_today}&order=desc&sort=creation&site=stackoverflow Because as the null return is empty, I didn't understand how it would enter the url. Thanks for support @Glorfindel! Commented May 11, 2022 at 17:16
  • 1
    That is not possible. I know the word 'filter' suggests that, but it only filters the output. The API only supports the parameters visible in the 'form' on the documentation page. You would need to use SEDE to do that, but SEDE is updated only once a week.
    – Glorfindel
    Commented May 11, 2022 at 20:52

You must log in to answer this question.

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