Table of Contents

Examples Overview

This guide is for developers who want to learn TorBoxSDK by starting from runnable code instead of isolated snippets.

The examples live in the examples project:

The project currently contains 38 runnable scenarios grouped by onboarding, Main API workflows, Search API usage, Relay usage, and error handling patterns.

What the examples show

  • dependency injection setup with AddTorBox()
  • standalone TorBoxClient usage without DI
  • configuration binding from appsettings.json
  • end-to-end Main API workflows such as creating, listing, editing, and controlling downloads
  • Search API workflows for torrents, Usenet, metadata, tutorials, and download handoff
  • Relay API monitoring calls
  • production-oriented error handling and cancellation patterns

How to use this documentation

Start with the runner and setup examples if you are new to the SDK. Move to the Main API guide when you want real resource workflows. Use the Search, Relay, and error-handling guide when you need cross-cutting patterns.

Guides in this section

Quick mapping

Need Guide
Run the menu-driven sample app Running the Examples Project
Configure DI, appsettings.json, or standalone client usage Setup and Configuration Examples
Explore torrents, Usenet, web downloads, user, integrations, notifications, RSS, vendors, queued, stream, or general endpoints Main API Examples
Explore Search API, Relay API, and resilience patterns Search, Relay, and Error Handling Examples

Guidance for copying examples into real applications

  • Replace placeholder IDs, tokens, hashes, file paths, and URLs before running any workflow.
  • Prefer environment variables or configuration binding for secrets; do not hardcode API keys.
  • Keep the CancellationToken pattern used in the examples.
  • Treat ExampleHelper as sample infrastructure, not as part of the public SDK surface.