Stem Docs

List Circuits

List CircuitsΒΆ


Tor creates new circuits and tears down old ones on your behalf, so how can you get information about circuits Tor currently has available?

from stem import CircStatus
from stem.control import Controller

with Controller.from_port(port = 9051) as controller:

  for circ in sorted(controller.get_circuits()):
    if circ.status != CircStatus.BUILT:

    print("Circuit %s (%s)" % (, circ.purpose))

    for i, entry in enumerate(circ.path):
      div = '+' if (i == len(circ.path) - 1) else '|'
      fingerprint, nickname = entry

      desc = controller.get_network_status(fingerprint, None)
      address = desc.address if desc else 'unknown'

      print(" %s- %s (%s, %s)" % (div, fingerprint, nickname, address))
% python

Circuit 4 (GENERAL)
 |- B1FA7D51B8B6F0CB585D944F450E7C06EDE7E44C (ByTORAndTheSnowDog,
 |- 0DD9935C5E939CFA1E07B8DDA6D91C1A2A9D9338 (afo02,
 +- DB3B1CFBD3E4D97B84B548ADD5B9A31451EEC4CC (edwardsnowden3,

Circuit 6 (GENERAL)
 |- B1FA7D51B8B6F0CB585D944F450E7C06EDE7E44C (ByTORAndTheSnowDog,
 |- EC01CB4766BADC1611678555CE793F2A7EB2D723 (sprockets,
 +- 9EA317EECA56BDF30CAEB208A253FB456EDAB1A0 (bolobolo1,

Circuit 10 (GENERAL)
 |- B1FA7D51B8B6F0CB585D944F450E7C06EDE7E44C (ByTORAndTheSnowDog,
 |- 00C2C2A16AEDB51D5E5FB7D6168FC66B343D822F (ph3x,
 +- 65242C91BFF30F165DA4D132C81A9EBA94B71D62 (torexit16,