JSON API for Recent Popular Topics (Similar to the Email Digest)

(Lowell Heddings) #1

I’m interested in pulling a list of the recently popular discussions for use on my primary web site and email newsletter. Is there an API to get 10 “hot topics” from the last day or two, along with the relevant details (number of posts, etc).

Essentially I’d like something similar to the digest email but in JSON format.

New JSON Feed and Discourse
(Ben T) #2

I believe the json file for that is https://your-install/top/daily.json . The period can be changed to weekly or beyond.

(Robin Ward) #3

That part of the email doesn’t have an API endpoint outside of “send digest.” The issue is it’s specific to the user who is receiving the digest.

However, as @trident pointed out, the non-user specific part is filled in by top topics. So you could use that endpoint to get approximately what other users should see.

(Lowell Heddings) #4

That daily.json doesn’t give a very interesting list.

(Robin Ward) #5

What about weekly.json?

(Jeff Atwood) #6

Weekly is more equivalent to what is in the weekly digest emails, anyway!

(Lowell Heddings) #7

Yeah, it’s reasonable. My forum isn’t that busy anyway at the moment so it’ll be fine for now.