NEW YORK — Ricky Jay, a magician, historian of oddball entertainers and actor who appeared in “Boogie Nights” and other films, has died. He was 72.

Jay died of natural causes at his home in Los Angeles, according to his manager, Winston Simone.

Jay appeared in several films and television series, including as a cameraman in “Boogie Nights,” in “Magnolia” and “Tomorrow Never Dies” and in HBO’s “Deadwood.” He consulted on “Ocean’s Thirteen” and “Forrest Gump” and collected rare books on unusual entertainers and performers dating back hundreds of years.

His one-man shows played to packed audiences, where his sleight-of-hand artistry impressed even fellow magicians. In one famous trick, he would pierce a watermelon with a card flung through the air.

He also wrote several books on magicians and their craft, including “Dice: Deception, Fate and Rotten Luck.”

Jay was fond of stories of oddball characters, and wrote a book about Matthias Buchinger, an 18th-century German magician born without legs and hands.