The credit and financial website WalletHub took the occasion of the nation’s birthday to determine what U.S. city is the best place to celebrate the Fourth of July. Using 20 key metrics to rank the 100 largest American cities, New York City came in first place,with Washington, D.C., coming in fourth.

Los Angeles took second place, San Diego came in third, and, following D.C., Las Vegas ranked No. 5.

“There’s nothing more American than going all out on Fourth of July,” WalletHub wrote about its research. “We grill, we drink and we blow stuff up — all in the name of freedom. But freedom is not free.”

“Everything from hotdogs to travel to hospital bills following fireworks accidents costs major scratch,” Wallethub wrote. “In fact, the National Retail Federation projects that American households this year will spend a collective $6.8 billion — down from last year’s $6.9 billion — on Fourth of July food alone.”

Metrics included the cost of beer and wine, fireworks shows, and the Fourth of July weekend weather forecast.

Based on the data collected, the American cities rounding out the Top ten best places to celebrate the Fourth of July are, in order: Dallas, Atlanta, Chicago, San Francisco, and St. Louis.

The American cities in the bottom ten are, from 91 to 100 — Aurora, Colorado; Chula Vista, California; Corpus Christi, Texas; Laredo, Texas; Bakersfield, California; Birmingham, Alabama; Hialeah, Florida; Lubbock, Texas; Memphis, Tennessee; and San Bernardino, California.

The WalletHub report also includes these Independence Day facts and figures:

Follow Penny Starr on Twitter