Skip to content
Back to top
View this page
Edit this page

# Torznab WebAPI

Torznab is an API specification that provides a standardized way to query torrent site for content. It is used by a number of torrent applications, including Prowlarr and Jackett.

Using this engine together with Prowlarr or Jackett allows you to search a huge number of torrent sites which are not directly supported.

## Configuration

The engine has the following settings:

`base_url`:

  Torznab endpoint URL.

`api_key`:

  The API key to use for authentication.

`torznab_categories`:

  The categories to use for searching. This is a list of category IDs. See Prowlarr-categories or Jackett-categories for more information.

`show_torrent_files`:

  Whether to show the torrent file in the search results. Be careful as using this with Prowlarr or Jackett leaks the API key. This should be used only if you are querying a Torznab endpoint without authentication or if the instance is private. Be aware that private trackers may ban you if you share the torrent file. Defaults to `false`.

`show_magnet_links`:

  Whether to show the magnet link in the search results. Be aware that private trackers may ban you if you share the magnet link. Defaults to `true`.

## Implementations

searx.engines.torznab.init(engine_settings=None)

  Initialize the engine.

searx.engines.torznab.request(query: str, params: dict [ str , Any ]) → dict [ str , Any ]

  Build the request params.

searx.engines.torznab.response(resp: SXNG_Response ) → list [ dict [ str , Any ]]

  Parse the XML response and return a list of results.

searx.engines.torznab.build_result(item: Element ) → dict [ str , Any ]

  Build a result from a XML item.

searx.engines.torznab.get_attribute(item: Element, property_name: str ) → str | None

  Get attribute from item.

searx.engines.torznab.get_torznab_attribute(item: Element, attribute_name: str ) → str | None

  Get torznab special attribute from item.