XF 2.1 Using API to get stats?

adamgreenough

Well-known member
Hi! I have been trying to use the API to get stats for the homepage of my site (non xenforo).

I am looking for...
  • Total number of threads
  • Total new threads last 7 days
  • Total users
  • Total new users last 7 days
  • Total posts
  • Total new posts last 7 days
So far I've just managed to get the total number of threads. Does anyone know if this is possible with the current API?
 
Spontaneous idea: Calling /threads should give you the first thread page along with the number of available pages. From there you could take the threads per page * number of pages for an "estimate" or if you need the exact count, you can query the last page.

I'd honestly rather implement a custom endpoint that just returns all stats in an orderly fashion instead though. Pretty trivial to do.
 
Back
Top Bottom