Cloud function to retrieve rating