and see if that solves your issue. But personally I would build my URL into a variable and pass that into the requests.get instead of trying to do it all in one line. Plus that makes it easier to debug as you can print the variables and make sure they are being read/generated correctly.