-
Notifications
You must be signed in to change notification settings - Fork 17
Nyaa.si
Kylart edited this page Oct 22, 2017
·
12 revisions
Currently writing this page
const {si} = require('nyaapi')
[si] methods:
si.search(term, n = null, opts = {})
opts
may contain one of those:
opts = {
filter: 2, # Represents the filter you want to apply to your research.
category: '1_1' # Represents the category you are looking for in your research.
}
There are two ways of using this method.
- 3 arguments
si.search('HorribleSubs', 20, {
filter: 2,
})
.then((data) => console.log(data))
.catch((err) => console.log(err))
- 1 object argument
si.search({
term: 'HorribleSubs',
n: 20,
filter: 2,
})
.then((data) => console.log(data))
.catch((err) => console.log(err))
If no n
parameter is given, nyaapi will call the searchAll
method with the same term
and options
.
si.searchAll(term, opts = {})
opts
may contain one of those:
opts = {
filter: 2, # Represents the filter you want to apply to your research.
category: '1_1' # Represents the category you are looking for in your research.
}
There are two ways of using this method.
- 2 arguments
si.search('HorribleSubs', {
filter: 2,
})
.then((data) => console.log(data))
.catch((err) => console.log(err))
- 1 object argument
si.search({
term: 'HorribleSubs',
filter: 2,
})
.then((data) => console.log(data))
.catch((err) => console.log(err))