This is the correct approach, however only after you verify that each quote includes the same considerations in the APR. Some lenders will only quote including their own origination fees. Others will include all fees/charges including third party fees like title and settlement (estimated).
If they don’t include the same things in the APR that’s presented, then it’s apples and oranges and the APR comparison is less meaningful.
An alternate method to compare is to look at the same rate at the different lenders. Then convert any points to $$$$ (1 point = 1% of the loan amount) and add that to any/all lender fees, including the same parts for each lender (either include third party or leave it out for all). Now, at any given interest rate you can directly compare the cost at each lender.
Rates usually change daily but can sometimes even change more than once a day, such as if there’s lots of market volatility. So, you need to obtain the quotes from each lender on the same day to do the comparison.