How can I check if IP is a Tor exit node?
The Tor Project has a tool to do this at:
https://exonerator.torproject.org/
For automated lookups, they also provide a DNSBL-based lookup; information on that is available at:
https://www.torproject.org/projects/tordnsel.html.en