Data Explorer Plugin

Are there even any endpoints I can hit to obtain the data I query in Data Explorer? I checked public Discourse API but actually found nothing

Totally doable. You can inspect the API call your browser makes for details. It gives you all the info and works wonders for pretty much every action done on Discourse.

3 Likes

How can I prevent Data Explorer from cooking the results? Example:

SELECT group_id, user_id FROM group_users

What I get:

image

What I want:

image

Export the data to a file, is the typical way you handle that.

The plugin has the “use the whatever_id to get the fancy” feature. I like it, but it did catch me a bit by surprise at first.

What I have done when I’ve wanted the numbers not the fancy is to use aliases eg.
… whatever_id AS whateverid …

Not as easy to read without the underscore but it gets the numbers.

6 Likes

Don’t get me wrong, I like it too. But occasionally I need the numbers. Your suggestions works for me, thanks.

3 Likes

Is there a way to format a column to show an icon with a link? I just query the uploads, but URLs in the result are so long.

Is there a way to force the JSON export to be JSON with “key”:“value” pairs?

We are exporting a huge amount of data, the JSON payload currently looks like:

        44788,
        19363,
        1,
        22,
        21,
        41,
        4020

So just the value part with no key… “key”: “value”


In order to forward it on to a place where we can chart it over time (charting the view/like counts to see which posts get more popular being a basic example), we need the JSON to come in “key”:“value” pairs…

        "views": 44788,
        "userId": 19363,
        "replyCount":1,
        "avgTime": 22,
        "likeCount": 21,
        "categoryId":141,
        "wordCount": 4020

I’m struggling to find anything I can add on to the SQL, but maybe I’m missing something. Any one here have any tips?

Hey there!

How would I go with Data Explorer queries about fetching number of solutions provided per users let’s say per month?

There are a couple of example data explorer queries at the bottom of the plugin’s topic - they could be useful as a starting point:

3 Likes

The problem with this query at the bottom is that it gives a number of accepted solutions so the sum of the ones someone accepted as a solution as well as the ones that someone given and were accepted by someone else as a solution. I want to create a query that will fetch users and the number of solutions only they themselves provided.