Table of Contents

Search, Relay, and Error Handling Examples

These examples cover the remaining SDK families outside the Main API and the cross-cutting error-handling patterns that apply everywhere.

Search API examples

The Search API examples show how to query torrents, Usenet, metadata, and tutorials, then retrieve or hand off results.

Scenario Source file
Search torrents and fetch result details by ID SearchTorrentsExample.cs
Search Usenet content SearchUsenetExample.cs
Search metadata such as movies and TV SearchMetaExample.cs
Search tutorials SearchTutorialsExample.cs
Download search results and retrieve search entries by ID DownloadSearchResultsExample.cs

If you want a good first Search API example, start with SearchTorrentsExample.cs. It demonstrates a simple query, advanced options, TV-specific filters, and a follow-up detail call.

Relay API example

The relay surface is covered by a focused example:

Scenario Source file
Check relay server status and torrent inactivity RelayExample.cs

Use it when you need to understand client.Relay workflows rather than content-management workflows in client.Main.

Error handling patterns

The error-handling example is useful even if you are not using the menu runner. It acts as a reference for production code structure.

Pattern Source file
API-level TorBoxException handling ErrorHandlingExample.cs
HttpRequestException transport failures ErrorHandlingExample.cs
timeout and cancellation behavior ErrorHandlingExample.cs
combined production-style catch structure ErrorHandlingExample.cs