Coronavirus rapid test kits are in high demand and short supply in the Philadelphia area as people scramble to confirm they’re healthy before gathering with friends and family for Christmas this week.

The Philadelphia Department of Health is giving out free at-home test kits at nine pop-up clinics throughout the city this week, with a goal of handing out 24,000 before Christmas. Hundreds of people stood in line outside libraries and recreation centers Monday for the kits, which each contain two COVID tests, and supplies quickly ran out, leaving dozens standing out in the cold, empty-handed. City officials encouraged anyone who had waited for a test without getting one Monday to try again another day this week.

“We know that it’s increasingly difficult to find testing and testing materials anywhere in the region, so we hope that this helps alleviate some of the burden,” said James Garrow, a spokesperson for the Philadelphia Health Department. “We wish we had millions of tests to give away, but unfortunately that’s not possible.”

Photos posted on Twitter showed lines around the block at West Philadelphia’s Haverford Library, where 500 kits had been distributed by Monday afternoon, and more people waited for a chance at one of the 150 kits in the clinic’s third delivery of the day. Numerous people said they were trying to get the free kits after they found they couldn’t buy them online or at retailers because they’re in such short supply.

The city is giving out two kits per person and four per household, said Matt Rankin, a spokesperson for the Health Department.

The city is also giving test kits to homeless residents through its outreach programs. Walk-up testing with both PCR and antigen tests is still available at a number of pop-up testing sites throughout the city. (Residents should expect PCR results — considered the most accurate — within 24 to 48 hours, he said.)

Bill and Ellen Powell got in line at their neighborhood rec center in Frankford around 1:15 p.m. — 15 minutes after the center began handing out tests — only to be told 15 minutes later that the clinic had already run out, after distributing 375 kits.

The Powells, like many in line, had hoped to get rapid tests so they could feel safer seeing family for the holidays. It wasn’t likely those plans would change without the tests, Bill Powell said, but “it sort of puts a damper on things.”

Clarence Nelson, 63, of West Oak Lane, was one of the last to get test kits at the Frankford pop-up clinic. He wanted to pick up a test to help keep everyone in his home safe.

Nelson has had COVID twice and was asymptomatic both times, he said. But he believes he unknowingly infected a friend in October, who nearly died from the virus.

“Any time you can get a rapid test, that’s more tools you can use,” he said. “It’s not so much me I’m concerned about, as it is about everyone else.”

At Widener Library in the Strawberry Mansion neighborhood, Health Department officials handed out a total of 400 kits, including 300 in the first two hours.

Jaiden Manning, a 24-year-old receptionist from Fishtown, wanted a test because she was weighing whether to fly home to her family in San Diego later this week.

“I’m a little bit nervous seeing how rapidly [the omicron variant] is spreading,” she said. “I’m going to get tested, get the results, and go from there.”

Outside the Widener Library, Phong Duong and his wife, Quin, decided to stay in line, waiting for the new shipment of tests. They’d already been waiting for about an hour.

“We just want to make sure we have it on hand,” Duong, 55, of Mount Airy, said. “Given the case increases, it sounds like they are going to get worse before it gets better.”

In line, John and Tesia Barone, also from Mount Airy, said they had become more wary over the last few days, hearing reports of rising cases. And they’d been unable to find rapid tests online. John Barone, a wedding photographer, said he’d lost nearly his entire income in 2020 because of cancellations. He feared another round of cancellations was on the way: a client had just called to indefinitely postpone a wedding in the coming weeks.

G. Savior, 57 of Nicetown, has immunocompromised parents and wanted to make sure he could be around them safely. He’s cut back on most of his holiday plans.

“I won’t be in large crowds, and I’ve declined invitations to parties,” he said.

He said he’d been unable to find affordable rapid tests in pharmacies.

“We sell out as soon as we get them in,” said a pharmacy technician at a CVS in Media.

A nearby Rite Aid had received a couple boxes, but sold the first within an hour, even though customers were limited to two packages each. A second box lasted a little longer by allowing only one per customer, a cashier said.

CVS is working “around the clock” to maintain inventory of at-home COVID-19 tests, and have protocol for stores to “rapidly replenish supply” when they run out, said Michael DeAngelis, a spokesperson for CVS.

“We recognize the convenience of rapid at-home testing kits, especially considering holiday travel schedules,” said Jeffrey Olson, a spokesperson for Rite Aid. “But in many areas, demand is simply outpacing supply from manufacturers.”

Representatives for both pharmacies encouraged people to consider in-store testing if they’re unable to get an at-home test kit.

A store associate at a Brookhaven Walgreens proudly pointed to a shelf full of Abbott’s BinaxNOW rapid tests. A pack of two cost $23.99.

Delaware and Montgomery Counties are not giving out free at-home tests, but their testing sites remain open for free on-site tests.

At the Personic Health Care testing site at the Springfield Mall in Delaware County, at least a dozen cars were in line for drive-up or by-appointment tests Monday morning. By 1 p.m., there was no wait to get a PCR or rapid test without an appointment.

Polymerase Chain Reaction, or PCR, tests are considered the gold standard for detecting COVID-19 because they can pick up smaller amounts of the virus, for instance among individuals who are asymptomatic. Results take longer to receive, and the tests may cost more.

Antigen tests, also called rapid tests, are effective in detecting the virus among people who are experiencing symptoms and have a high viral load. They’re less expensive and can produce results within 15 minutes at home.

Personic’s Springfield Mall site has been seeing about 700 cars a day — a major bump from the 250-300 it had been seeing a few months ago, said Shawn Naqvi, chief medical officer at Personic, a Delaware County-based company that launched during the pandemic to provide COVID-19 testing.

Naqvi said he expects to be able to accommodate the surge in demand with a second test site in Springfield and another in West Chester. The tests are free, though the company bills insurance for patients who have it.

So far, Montgomery County has been able to keep up with demand for tests at its five free test sites, though people may have to wait a little longer — up to three days, instead of two — to get the results back because of high volume, said Kelly Cofrancisco, a Montgomery County spokesperson.

James O’Malley, a spokesperson for Bucks County, said the county is not currently offering widespread COVID-19 testing. Mass testing sites were converted to vaccine clinics earlier in the year.

“Our limited testing efforts have been focused primarily on students and teachers. The county also periodically tests unvaccinated county employees,” O’Malley said.

New Jersey will be opening more community testing sites this week and has partnered with a company to provide free at-home testing kits to any resident who wants one. New Jerseyans can get the free test kits at learn.vaulthealth.com/nj and locate the nearest testing site at covid19.nj.gov/testing.

Back in Philadelphia, Pio Voluntad, 60, was one of the last to receive tests at Widener on Monday before the site ran out. He wanted to test himself for COVID before seeing his 88-year-old mother, he said

During the last holiday season, he said, he stood in his mother’s driveway and called to her as she waved from a second-floor balcony. This year, he was hoping to get a bit closer.

“I’m cautious about it, but you have to live,” he said. “I wasn’t going to go unless I got these [tests] — I tried to purchase them. You can’t get them anywhere. It’s scary. It’s scary for everyone.”

Staff writers Erin McCarthy and Rob Tornoe contributed to this article.