Code to fetch temperature data