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.

    • KromonosOP
      link
      fedilink
      52 years ago

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

      • @nutomicMA
        link
        52 years ago

        Sounds interesting!

  • KromonosOP
    link
    fedilink
    7
    edit-2
    2 years ago

    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.

    • @nutomicMA
      link
      6
      edit-2
      2 years ago

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

    • @the_tech_beast
      link
      32 years ago

      Where do I add these configurations in searx? I dont self host searx

  • @boi
    link
    52 years ago

    Big searx supporter here, absolutely agree