Skip to content

Docs for Nyaa.si

Juanjo Salvador edited this page Jul 18, 2024 · 7 revisions

Nyaa.si is a replacement for NyaaTorrents (nyaa.se) since its disappearance few time ago. It doesn't provide any public API, so I needed to use web scraping methods to make this library.

For this purpose I'm using BeautifulSoup.

Nyaa.search(keyword, [category, subcategory, filters, page])

Returns a list of dictionaries with the search results.

Parameter Type
keyword String Keyword for the search query
category Integer See Categories list
subcategory Integer See Categories list
filters Integer See Filters list
page Integer Number between 0 and 1000

Example code

    Nyaa.search(keyword="Shoukoku no Altair", category=1)

Returns a list of Torrent objects.

    'category': "Anime - English-translated",
    'url': "https://nyaa.si/view/968600",
    'name': "[HorribleSubs] Shoukoku no Altair - 14 [720p].mkv",
    'download_url': "https://nyaa.si/download/968600.torrent",
    'magnet': <magnet torrent URI>
    'size': "317.2 MiB",
    'date': "2017-10-13 20:16",
    'seeders': "538",
    'leechers': "286",
    'completed_downloads': "852"

Nyaa.last_uploads(number_of_results)

Returns a list of Torrent objects with most recent uploads from Nyaa site.

Parameter Type
number of results Integer Number of results you want to see
    Nyaa.last_uploads(20)