api.rst 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. .. _adminapi:
  2. ==================
  3. Administration API
  4. ==================
  5. Get configuration data
  6. ======================
  7. .. code:: http
  8. GET /config HTTP/1.1
  9. Sample response
  10. ---------------
  11. .. code:: json
  12. {
  13. "autocomplete": "",
  14. "categories": [
  15. "map",
  16. "it",
  17. "images",
  18. ],
  19. "default_locale": "",
  20. "default_theme": "simple",
  21. "engines": [
  22. {
  23. "categories": [
  24. "map"
  25. ],
  26. "enabled": true,
  27. "name": "openstreetmap",
  28. "shortcut": "osm"
  29. },
  30. {
  31. "categories": [
  32. "it"
  33. ],
  34. "enabled": true,
  35. "name": "arch linux wiki",
  36. "shortcut": "al"
  37. },
  38. {
  39. "categories": [
  40. "images"
  41. ],
  42. "enabled": true,
  43. "name": "google images",
  44. "shortcut": "goi"
  45. },
  46. {
  47. "categories": [
  48. "it"
  49. ],
  50. "enabled": false,
  51. "name": "bitbucket",
  52. "shortcut": "bb"
  53. },
  54. ],
  55. "instance_name": "searx",
  56. "locales": {
  57. "de": "Deutsch (German)",
  58. "en": "English",
  59. "eo": "Esperanto (Esperanto)",
  60. },
  61. "plugins": [
  62. {
  63. "enabled": true,
  64. "name": "HTTPS rewrite"
  65. }
  66. ],
  67. "safe_search": 0
  68. }
  69. Embed search bar
  70. ================
  71. The search bar can be embedded into websites. Just paste the example into the
  72. HTML of the site. URL of the SearXNG instance and values are customizable.
  73. .. code:: html
  74. <form method="post" action="https://example.org/">
  75. <!-- search --> <input type="text" name="q">
  76. <!-- categories --> <input type="hidden" name="categories" value="general,social media">
  77. <!-- language --> <input type="hidden" name="lang" value="all">
  78. <!-- locale --> <input type="hidden" name="locale" value="en">
  79. <!-- date filter --> <input type="hidden" name="time_range" value="month">
  80. </form>