# \_mod\_TRAKT

Provider ID: `TRAKT`\
Version (module): `3.2.0`

{% tabs %}
{% tab title="End users" %}
Trakt support in the sync engine.

Use it to sync:

* watchlist
* history
* ratings

Setup docs:

* [Auth: Trakt](/crosswatch/providers/authentication/auth-trackers/auth-trakt.md)
* [Adapter: Trakt](/crosswatch/providers/synchronization/adapter-trakt.md)
  {% endtab %}

{% tab title="Power users" %}
**Entry point:** `sync/_mod_TRAKT.py`

### Provider surface

* `health()`
* `build_index(feature)`
* `add(feature, items)`
* `remove(feature, items)`

### Features

* `watchlist` → `providers/trakt/_watchlist.py`
* `history` → `providers/trakt/_history.py`
* `ratings` → `providers/trakt/_ratings.py`

### Capabilities

* `bidirectional: true`
* `provides_ids: true`
* `index_semantics: "present"`

### Config

Config block name:

* `Trakt` or `trakt`

Common keys:

* `client_id`, `access_token`
* `timeout` (default `15.0`)
* `max_retries` (default `3`)
* `history_number_fallback` (default `false`)
* `history_collection` (default `false`)

### Gotchas

`history_number_fallback` can change episode matching behavior.

Use it only if your library numbering is consistent.

<details>

<summary>Runtime call flow</summary>

```
Orchestrator
  └─ OPS.build_index(cfg, feature)
       └─ TRAKTModule.build_index(feature)
            └─ providers/trakt/_{feature}.py : build_index(adapter, ...)
```

Writes are symmetric:

```
Orchestrator plan → OPS.add/remove(...)
  └─ TRAKTModule.add/remove(feature, items, dry_run=...)
       └─ providers/trakt/_{feature}.py : add/remove(adapter, items)
```

</details>

<details>

<summary>OPS contract</summary>

* `name()`
* `label()`
* `features()`
* `capabilities()`
* `is_configured(cfg)`
* `build_index(cfg, feature=...)`
* `add(cfg, items, feature=..., dry_run=False)`
* `remove(cfg, items, feature=..., dry_run=False)`
* `health(cfg)`

</details>

<details>

<summary>Capabilities (raw)</summary>

```json
{
  "bidirectional": true,
  "index_semantics": "present",
  "provides_ids": true,
  "ratings": {
    "from_date": false,
    "types": {
      "episodes": true,
      "movies": true,
      "seasons": true,
      "shows": true
    },
    "unrate": true,
    "upsert": true
  }
}
```

</details>

<details>

<summary>Full config reference</summary>

Config namespace:

* `cfg["trakt"]` (fallback: `cfg["auth"]["trakt"]`)

Fields:

* `client_id`
* `access_token`
* `timeout` (default: `15.0`)
* `max_retries` (default: `3`)
* `history_number_fallback` (default: `false`)
* `history_collection` (default: `false`)

Dependencies:

* `requires: []`

Endpoints:

* `https://api.trakt.tv`

</details>
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.crosswatch.app/blueprint-architecture/sync/_mod_trakt.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
