I'm trying to build a bot but I need it that Tor will change servers every time I refresh the page. I could also use one if I get to manually change it using a command line. Any suggestions?

  • When you say "change servers", do you mean change to a new circuit? Or do you mean change a specific node? For example, a new entry (guard) node, or a new exit node? Nov 15, 2015 at 22:03
  • Which platform are you using? (Windows, Linux, Mac OS?) Nov 15, 2015 at 22:04

2 Answers 2


Yes you can. I recommend using Stem to control your tor circuit. Hopefully that points you in the right direction. The link also has a menu with tutorials at the top that have some great examples to get used to using it. Good luck with your bot, I've made a few for Tor so I know it can be done.


Yes. You can use stem.

Assuming your Tor control port is 9051 and no cookie or password is needed, the following code will initialize a controller object.

import stem
import stem.control

Then, each time you want a new circuit, you can use


By default, Tor will only establish a new circuit in this way at most every 10 seconds. If you want to have new circuits more frequently, you will need to changed the source code. MAX_SIGNEWNYM_RATE means the interval in seconds (although its name suggests the rate) at which it will accept the signal NEWNYM.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .