API Command for Reports

api

(Braden Keith) #1

I want to use the API to pull all user statistics in order to track Discourse usage in my community. I like the data included in Admin/users/ > Export Users. However, this is a CSV. I want to use a API command to get the same dump and process it on my system.

admin/export_csv/users.json will initiate the export, but it still outputs as a CSV and requires manual interaction to download and process. Any ideas how to get the following information for all users and per user?

topics_entered
posts_read_count
time_read
topic_count
post_count
likes_given
likes_received

/users/{$userName}.json does not contain this information from what I have seen.


(Braden Keith) #2

I am seeing /users/{$userName}.json returns some of this data under Users > Stats

Action Type 13 = Messages
Action Type 12 = Unread Messages ?
Action Type 4 = Topics
Action Type 5 = Posts
Action Type 6 = Replies
Action Type 1 = Likes Given
Action Type 1 = Likes Received

So:
topic_count
post_count
likes_given
likes_received

are taken care of. Still have a few gaps…


(Kane York) #3

Have you tried /admin/users/{username}/json?