Request barset data error

Ocassionally, I got the 401 error when my program make a request for barset data. I am not sure why this happens. Any suggestions? Thanks!

requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url

Your URL you are requesting either does not exist or you have your keys wrong. Remember as well you cant access live market trading with a paper account as well, you need to access the paper api.