Learning about
the bittorrent protocol is the place to start. Using a library which interfaces with the protocol and utilizing it to get what you want is the next step. According to the
Bittorrent Protocol Specification tracker responses are bencoded dictionaries with keys listed. Basically, you do a simple HTTP GET request to a tracker and receive a bencoded dictionary as a response and use a library to decode it for the bits you want. There's a place where you can start short of writing the actual program to do it. It would be good to check out one of the many open source bittorrent clients (transmission, bittornado, or even the twitter murder implementation of bittornado). The resources are numerous after some quick web searching.