President Obama’s top spokesman is complaining that his boss hasn’t gotten enough respect from the media — especially the folks at The New York Times. But he couldn’t have picked a worse specific gripe.

The Obama “achievement” he demands the press admire is the one where even all the folks in the Obama-loving mainstream media agree the president’s been a total failure.

Press Secretary Josh Earnest penned a letter to the Times complaining about media columnist Jim Rutenberg’s charge that, if elected, Hillary Clinton’s administration — like Obama’s — “would continue the tradition of being still more secretive than the one before it.”

No way, cried Earnest. After all, he wrote, Obama pledged to be “the most transparent president in history” — a promise he insists the president has fulfilled.

Uh-huh. Try finding any reporter who covers Team Obama who’ll agree.

This is the same administration that has denied the most Freedom of Information requests in history, stretching searches out for years, demanding outrageous fees and arguing in court that such requests should be “narrowly construed” to limit them.

It has prosecuted nine journalists over news leaks — more than all other presidents combined.

And its officials boast about deliberately spreading false talking points to bolster Obama’s nuclear deal with Iran.

All of which is why fully three years ago, the Committee to Protect Journalists, in a report by former Washington Post Executive Editor Leonard Downie, charged that “this administration’s war on leaks and other efforts to control information are the most aggressive I’ve seen since the Nixon administration.”

And why veteran ABC News White House correspondent Ann Compton called Obama “the least transparent of the seven presidents I’ve covered.”

When politicians like Obama, Gov. Cuomo and Mayor de Blasio all claim to be the most transparent to ever hold their offices — as they all have — you can be certain the exact opposite is true.