Fetch posts sorted by date


Api version 0.1

My query has a filter looking like this

But the posts returned are not ordered by published_at, they seem ordered by random.

How can I get ordered by published_at?

Without the filter they are returned sorted by published_at

Hi @banana_303 :wave: Sounds like a regression to me, will be able to have a closer look into it on Monday. In a meanwhile, could you provide a bit more context around what version of Ghost and environment/configuration you are using? Did you try running similar queries against Content/Admin v2 APIs?


We are using a Docker container with node:10-slim

Tried also v2 api:

And url encoding the tags:

@banana_303 have you tried specifying an explicit order parameter? https://docs.ghost.org/api/content/#order

1 Like

Oh, didn’t know you could add that. It works! :smiley: Super, thank you!

I added this at the end of my url.

After some investigation came across this issue - https://github.com/TryGhost/Ghost/issues/10377 , so my conclusion is that that this is intended default behavior of Ghost when including filter for related object. Comes down to this line in code.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.