Grab the Halloween candy buckets and plastic bags and get ready to trick-or-treat.

Zillow released its annual 20 best cities for trick-or-treating last week. The ranking is based on home values, the proximity of homes to each other and crime rate. It does not factor which cities are most likely to give out king size candy bars versus fun size, however.

Philadelphia took the number one spot this year, followed closely by San Jose, as the city with the most candy and fewest walking and safety risks.

Here’s a look at the list:

1. Philadelphia

2. San Jose, Calif.

3. San Francsico

4. Milwaukee, Wis.

5. Los Angeles

6. Phoenix, Ariz.

7. Denver

8. Portland, Ore.

9. Seattle

10. Columbus, Ohio

11. Las Vegas

12. Baltimore

13. Dallas

14. San Diego

15. Charlotte, N.C.

16. Austin, Texas

17. Albuquerque, N.M.

18. Chicago

19. Nashville, Tenn.

20. Washington, D.C.

As all kids know, not all neighborhoods are created equal when it comes to trick-or-treating. Check out the full ranking and the best neighborhoods in each city.

Follow @MaryBowerman on Twitter.