1.0.5 • Published 3 years ago

searx-api v1.0.5

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
-
Last release
3 years ago

Installation

npm i searx-api

Examples

Can be found in folder examples

Simple usage (callback style)

const Searxuser = require('searx-api');

const searx = new Searxuser(
  'https://searx.kaikkitietokoneista.net//', //Url
  'https', //Protocol
  'en-US', //Language
  '1' //Safe search
)

searx.find("kaikkitietokoneista", function(err, data) {
  if (err === "rate_limited") {
    console.log("Cannot proceed. Searx server ratelimit has been exceeded.")
  } else {
    console.log("Searching for: " + data.query + "\n\n");

    data.results.forEach((item) => {
      console.log("TITLE: " + item.title + "\n\t URL: " + item.url);
    });  
  }
});

Async usage

const Searxuser = require('searx-api');

const searx = new Searxuser(
  'https://searx.kaikkitietokoneista.net//', //Url
  'https', //Protocol
  'en-US', //Language
  '1' //Safe search
)

try {
  const results = await searx.a_find("kaikkitietokoneista")
  results.forEach((item) => {
    console.log("TITLE: " + item.title + "\n\t URL: " + item.url);
  });
} catch(e) {
  // error occured while searching
  console.log("ERROR WHILE SEARCHING: ", e)
}
1.0.5

3 years ago

1.0.4

3 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago