Getting Discourse topics older than a certain date with curl



I try to create a list of Discourse topics that are older than 5 days (created 5 days ago or before that) with “curl GET …” command.
Currently I apply the following command to get a list of topics:
topiclist=$(curl -k -X GET “”)
…and then I parse the output (topiclist above) with jq for sorting out the old topics.

I wonder if it is possible to do this by adding the date info to the curl command and skip the parsing task (done with jq).

(Sam Saffron) #2

We have before and after to filter dates, use the advanced search UI to get the param names.

(Joffrey Jaffeux) #3

Inspecting XHR requests when using search UI will show this:

Request URL:
Request Method:GET

The curl request to get json content will be as simple as:

curl ""


Thanks a lot! It worked and it worked well :slight_smile:


By the way, where may I find a list of (all) advanced search UI parameters?
Are there usage examples too? Like the one that Joffrey wrote above?
I tried to google it but I found only info about the graphical web UI. I need to know the parameters for using with curl command.

(Joffrey Jaffeux) #6

Easiest way is probably to open network inspector and play with params in UI:


Thank you Joffrey,
But for doing this I have to know that there are parameters like

  • in that may have value “private” and “seen”
  • status that could be “open” and “closed”
  • before that should have a parameter like “2017-06-14”.
    …and so on.
    Is this info (completely or partly) listed anywhere?


Ok, you mean what is available is what is seen here in advanced search:

I found these parameters

(Mittineague) #9

You may find useful information by looking at this file

(Jay Pfaffman) #10

Perhaps I misunderstand, but It seems like you have missed that at least most of them are easily attainable on the advanced search page (and if not you, someone else stumbling here might have missed the most obvious solution). Just click “options” after you click the search icon.

(cpradio) #11

The screenshots in

Should also be helpful