From 1728 he was the librarian of the Biblioteca Pallavicini at Genoa and (after extensive travels through Europe) in 1732 became librarian at the private Biblioteca Riccardiana, belonging to the wealthy Riccardi family in Florence. He eventually attained a professorship of ecclesiastical history at the University of Florence, and was a court theologian and counselor to the Grand Duke of Tuscany. He died in 1770 and was buried in the Basilica di Santa Croce. His magnum opus was the eighteen-volume Deliciae eruditorum, a "hodge-podge of antiquarian lore" published over a span of decades at Florence. Lami was the first to describe the Byzantine manuscripts Minuscule 201, Minuscule 362, and Minuscule 370. He also wrote a Memorabilia, dedicated to the illustrious men of his time, and many other works of history and philology.
Lami was known for his contentious wit and anticlerical thought, one anecdote states that showing foreign visitors the urban Medici palace stated: There behold the cradle of literature then turning to the college of the Jesuits, and there behold its tomb.
He also started and edited from 1740-68 a erudite and scholarly journal, Novelle Litterarie, published in Florence and discussing subjects in all fields. After 1768, Giuseppe Bencivenni Pelli took his editorial position.
He died alone at home in Florence on 6 February 1770 and is buried in the church of Santa Croce, Florence. His huge monument, erected in 1772, lies on the south wall close to Galileo and opposite Michelangelo. His Latinised epitaph gives his name as Iovanni Lamio.
- Deliciae eruditorum, Florence, 1736–69.
- De eruditione Apostolorum, Florence, 1738.
- Lezioni di antichità toscane, Florence, 1766.