Using REST API and Python to retrieve data [retired]

HTTP 301 is not an error, but tells you that the location has changed:

print res.status, res.reason, res.getheader('Location')

In this specific case, TTN is redirecting you to the HTTPS URL:

301 Moved Permanently https://www.thethingsnetwork.org/api/v0/nodes/03FF8124/

That said: the new URL won’t work either, as the REST API is no more. You’ll have to use an alternative, like MQTT: A Python program to listen to your devices with MQTT. The storage integration has its own API; https://www.thethingsnetwork.org/docs/applications/storage/api.html