Skip to content

https://docs.joinmastodon.org/methods/trends/#statuses does not document the sort order #1292

@nikclayton

Description

@nikclayton

https://docs.joinmastodon.org/methods/trends/#statuses does not document the status sort order.

As far as I can tell, every other API call that returns an Array of Status returns them sorted by ID, greatest ID first.

/api/v1/trends/statuses does not do this.

At the time of writing (comments added to the shell output):

% curl -s https://mastodon.social/api/v1/trends/statuses | jq '.[] | .id'
"110993156080692938"   # <-- OK
"110993100663725000"   # <-- OK, less than previous entry
"110991377505473992"   # <-- OK, less than previous entry
"110993356930434838"   # <-- not OK, greater than all three previous entries
"110994790440934345"
"110994969037518867"
"110993372955365641"
"110994045539080889"
"110995529899922558"
"110995378605535724"
"110995385822431737"
"110995252446860759"
"110994722276318859"
"110993726425496697"
"110994378849093360"
"110995392607405730"
"110995293152118698"
"110995370486494187"
"110994608873854262"
"110992180569683389"

I am unsure if this is a bug in the code (I suspect it's sorting by some popularity algorithm, but have not confirmed this), or a bug in the documentation.

I saw this on mastodon.social, running v4.2.0-beta3+pr-26753-12e7b89

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions