The French government can go ahead with plans to trawl social media to detect tax avoidance, the constitutional court has ruled.
Customs and tax officials will be allowed to review users' profiles, posts and pictures for evidence of undisclosed income.
The new rules are part of a broader law on tax changes passed last week.
Human rights groups and the French data protection authority had expressed concern over the moves.
In its ruling, the court acknowledged that users' privacy and freedom of expression could be compromised, but it applied caveats to the legislation.
It said authorities would have to ensure that password-protected content was off limits and that they would only be able to use public information pertaining to the person divulging it online.
The court also said that regulators should closely monitor how the information was being exploited.
The mass collection of data is part of a three-year online monitoring experiment by the French government and greatly increases the state's online surveillance powers.
France's data watchdog CNIL said it recognised that the government's aims were legitimate but said the new policy would pose risks for individual freedoms.
Budget Minister Gérald Darmanin recently called the new rules "one more tool to fight fraud".
"If you say you're not a fiscal resident in France and you keep posting pictures on Instagram from France, there might be an issue," he told the newspaper Le Figaro.