Lemmy's search as JSON

Is it possible to get Lemmy’s search result in JSON format? E.g., to include the search in search engines like searx. That would be really awesome.

Kromonos
admin
creator
link
313d

Perfect. Now I take a look at searx settings and how I can integrate it.

@nutomic@lemmy.ml
mod
link
313d

Sounds interesting!

Kromonos
admin
creator
link
3
edit-2
12d

hmm 🤔 … Normally, the following in the settings.yml should do the trick:

  - name : lemmy
    engine : json_engine
    search_url : https://lemmy.ml/api/v3/search?q={query}&page={pageno}&type_=Posts
    results_query : posts
    url_query : post/ap_id
    title_query : post/name
    content_query : post/body
    categories : general, social media
    shortcut : le
    paging : True
    disabled : False

But my searx instance doesn’t even seem to fetch the JSON.

OK, I said nothing. It works 😆

https://search.bka.li/search?q=what is lemmy&categories=social+media&language=en-US

One now could add e.g. comments too with something like this:

  - name : lemmy comments
    engine : json_engine
    search_url : https://lemmy.ml/api/v3/search?q={query}&page={pageno}&type_=Comments
    results_query : comments
    url_query : post/ap_id
    title_query : post/name
    content_query : post/body
    categories : general, social media
    shortcut : lec
    paging : True
    disabled : False

As well as communities:

  - name : lemmy communities
    engine : json_engine
    search_url : https://lemmy.ml/api/v3/search?q={query}&page={pageno}&type_=Communities
    results_query : communities
    url_query : post/ap_id
    title_query : post/name
    content_query : post/body
    categories : general, social media
    shortcut : leco
    paging : True
    disabled : False

User search is possible too, but adding this would only support bullying.

@nutomic@lemmy.ml
mod
link
2
edit-2
12d

Cool! You should probably make a separate post for that.

@boi@lemmy.ml
link
313d

Big searx supporter here, absolutely agree

Kromonos
admin
creator
link
212d

See https://fapsi.be/post/2967/comment/10046 for the settings in searx 😊

Everything about Lemmy; bugs, gripes, praises, and advocacy.

For discussion about the lemmy.ml instance, go to !meta@lemmy.ml.

  • 0 users online
  • 5 users / day
  • 32 users / week
  • 66 users / month
  • 199 users / 6 months
  • 2 subscribers
  • 108 Posts
  • 785 Comments
  • Modlog