Getting JSON output for how many topics/replies/users the forum has?


(Travis) #1

I would like to display some stats on the primary (non-forum) site.

  • Total number of users
  • Total number of topics
  • Total number of posts

I’m also interested in any other little stats that might be cool to post. Is there any way to get json output for this? That landing site is just a static site hosted on S3 so something that can be used just via JS is ideal.


(Robin Ward) #2

Those stats are available via API, unfortunately they are only visible to admin users on the dashboard that @neil built. Also our API generally isn’t embeddable on other sites with just Javascript, with the exception of our embeddable comments.

You will likely have to get an API for an admin user, make the call to get the user counts, and create a static file on S3 with it.


(Travis) #3

Gotcha, thanks for your answer. I may just be terrible but I can’t seem to find documentation on those API items specifically.

Based on your description I’m thinking I’ll have to create a little ruby thing to run and get new stats each day or so and sync a json file to S3.


(Robin Ward) #4

There is unfortunately no documentation right now for our server side APIs. The main reason is we haven’t reached 1.0 and a lot of them are still in progress.

You should be able to make a call to /admin/dashboard.json using your API key to get the information you want.