# JSON API, get topics sorted by created\_at

**URL:** https://meta.discourse.org/t/json-api-get-topics-sorted-by-created-at/51638
**Category:** Development
**Created:** [10월 17, 2016, 11:53오전 UTC](https://meta.discourse.org/t/json-api-get-topics-sorted-by-created-at/51638 "2016-10-17T11:53:03Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![m45t3r](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/m45t3r/32/62853_2.png) [@m45t3r](https://meta.discourse.org/u/m45t3r)
#### Post date: [10월 17, 2016, 11:53오전 UTC](https://meta.discourse.org/t/json-api-get-topics-sorted-by-created-at/51638/1 "2016-10-17T11:53:03Z")

</div>

Hi

I am developing a blog-like interface for a private Discourse deployment based on the JSON API from Discourse. The idea is simple: the owner of the Discourse is the only one that can post questions in a certain category. This category will be used as a base for the posts in the blog.

The problem is, I can’t figure out how to get the topics sorted by `created_at`. `/latest.json` is almost there, however it sorts by `last_posted_at`, so if I made a blog based on `latest.json` the top posts would be the post last commented by an user, not the more traditional most recent created post.

Btw, the [Discourse API documentation](https://meta.discourse.org/t/discourse-api-documentation/22706) seems to be really outdated, since I discovered for example that passing `/latest.json?page=1` allow me to see the next 30 topics (each call from the API gives at most 30 topics and this does not seem to be documented anywhere).

---

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [10월 17, 2016, 1:04오후 UTC](https://meta.discourse.org/t/json-api-get-topics-sorted-by-created-at/51638/2 "2016-10-17T13:04:18Z")

</div>

> [@m45t3r](#):
>
> I am developing a blog-like interface for a private Discourse deployment

Nice! I like this idea. I played around with a blog layout in the past. Mostly I just modified the css to hide certain features I didn’t need or wanted other users to see.

> [@m45t3r](#):
>
> The problem is, I can’t figure out how to get the topics sorted by created\_at.

I’ll look into this, but not sure if an existing route exists off the top of my head.

> [@m45t3r](#):
>
> Btw, the Discourse API documentation seems to be really outdated

I’m currently working on updating the api docs. It will be done soon(ish) ;)💕

---

<div class="post-metadata">

### Author: ![m45t3r](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/m45t3r/32/62853_2.png) [@m45t3r](https://meta.discourse.org/u/m45t3r)
#### Post date: [10월 17, 2016, 1:07오후 UTC](https://meta.discourse.org/t/json-api-get-topics-sorted-by-created-at/51638/3 "2016-10-17T13:07:44Z")

</div>

Hi @blake, thanks to the fast answers!

> [@blake](#):
>
> Nice! I like this idea. I played around with a blog layout in the past. Mostly I just modified the css to hide certain features I didn’t need or wanted other users to see.

This would be an option too, however in this case I would still have the problem of the user bumping posts to the top when answering right? Or is there a way in Discourse itself to force posts sorted by `created_at`?

> [@blake](#):
>
> I’ll look into this, but not sure if an existing route exists off the top of my head.

Well, the other option would be to created a small server side application and sort the posts there, however this would be a uglier solution. The other option we’re thinking is to use a blog application and use Discourse only for comments, however the client would like to use Discourse itself to post new topics because he likes the interface.

---

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [10월 17, 2016, 1:14오후 UTC](https://meta.discourse.org/t/json-api-get-topics-sorted-by-created-at/51638/4 "2016-10-17T13:14:34Z")

</div>

> [@m45t3r](#):
>
> I would still have the problem of the user bumping posts to the top when answering right?

Yes. You would still have this issue.

---

<div class="post-metadata">

### Author: ![mcwumbly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcwumbly/32/103861_2.png) [@mcwumbly](https://meta.discourse.org/u/mcwumbly)
#### Post date: [10월 17, 2016, 1:15오후 UTC](https://meta.discourse.org/t/json-api-get-topics-sorted-by-created-at/51638/5 "2016-10-17T13:15:57Z")

</div>

Does this do what you need? [https://meta.discourse.org/latest.json?order=created](https://meta.discourse.org/latest.json?order=created)

---

<div class="post-metadata">

### Author: ![m45t3r](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/m45t3r/32/62853_2.png) [@m45t3r](https://meta.discourse.org/u/m45t3r)
#### Post date: [10월 17, 2016, 1:25오후 UTC](https://meta.discourse.org/t/json-api-get-topics-sorted-by-created-at/51638/6 "2016-10-17T13:25:18Z")

</div>

> [@mcwumbly](#):
>
> Does this do what you need? [https://meta.discourse.org/latest.json?order=created](https://meta.discourse.org/latest.json?order=created)

Yeah, it seems so. Thanks 😀 !
