Facebook has been forced to turn over photos from the accounts of nearly 400 users suspected of committing disability benefit fraud.
The record number of search warrants was issued by prosecutors who want to see whether people who are claiming disability benefits have posted photos of themselves taking part in vigorous activities.
In the past, Facebook photos showing people riding jet skis, playing golf and performing martial arts have led to successful prosecutions.
Facebook objected to the search warrants issued by New York state prosecutors, and was backed by Google and Microsoft.
But the state’s appeals court ordered Facebook to comply, saying it had no right to challenge the search warrants.
The district attorney’s office said the long-running investigation into fraud has already secured nearly $25m (£16m) from fraudsters.
A statement said: “In many cases, evidence on their Facebook accounts directly contradicted the lies the defendants told to the Social Security Administration.”
The 381 warrants were first served in 2013, and target public employees including police officers and firefighters who allegedly feigned illness in the wake of the 9/11 attacks.
Facebook had argued that government data requests should be narrower and more specific in scope.
But civil liberties groups said the court side-stepped the issue by ruling on Facebook’s right to challenge, rather than the warrant legality.
A Facebook spokesman said: “We continue to believe that overly broad search warrants – granting the government the ability to keep hundreds of people’s account information indefinitely – are unconstitutional and raise important concerns about the privacy of people’s online information.”