The English Romantic, John Keats (1795—1821), was always one of Wilde's favorite poets, indeed he considered him the greatest English poet of the century. When Wilde was just 22 and touring Europe he visited the grave of Keats; his reaction contained perhaps only a little irony when he said it was the holiest place in Rome.
Wilde wrote an article about the visit along with a verse in homage, which he later refined for his first book of Poems (1881). 
When Wilde lectured in Louisville, KY on his American lecture tour of 1882, he included in his a talk a reference to Keats' Sonnet on Blue.  By a happy chance in the audience that night, to listen to Wilde, was Keats' niece Emma Keats Speed, daughter of John Keats' brother George who had emigrated to America in 1818 before settling in Louisville a year later. Following Wilde's lecture Mrs Speed and Wilde were introduced to each other and they arranged to meet the next day at her home at 616 First Street, in Louisville. As Wilde recalled:
"When my lecture was concluded there came round to see me a lady of middle age, with a sweet gentle manner and a most musical voice. She introduced herself to me as Mrs. Speed, the daughter of George Keats, and invited me to come and examine the Keats manuscripts in her possession. I spent most of the next day with her, reading the letters of Keats to her father, some of which were at that time unpublished, poring over torn yellow leaves and faded scraps of paper, and wondering at the little Dante in which Keats had written those marvellous notes on Milton." 
A few weeks later, as his tour continued, Wilde received a surprise letter from Mrs Speed asking him to accept the original manuscript of the Keats sonnet. Wilde was overcome with emotion and gratitude. He wrote back to her from Omaha:
"What you have given me is more golden than gold, more precious than any treasure this great country could yield me......I am half enamoured of the paper that touched his hand, and the ink that did his bidding, grown fond of the sweet comeliness of his charactery, for since my boyhood I have loved none better than your marvellous kinsman, that godlike boy, the real Adonis of our age.... In my heaven he walks eternally with Shakespeare and the Greeks...." 
So memorable was the episode for Wilde that he later wrote an account of his experience in an article entitled 'Keats Sonnet on Blue' that appeared in The Hobby Horse, a quarterly Victorian periodical in England published by the Century Guild of Artists.
In 1885 Wilde attended a controversial auction in London of Keats ephemera. On that occasion he wrote the following sonnet:
These are the letters which Endymion wrote
To one he loved in secret, and apart.
And now the brawlers of the auction mart
Bargain and bid for each poor blotted note,
Ay! for each separate pulse of passion quote
The merchant’s price. I think they love not art
Who break the crystal of a poet’s heart
That small and sickly eyes may glare and gloat.
Is it not said that many years ago,
In a far Eastern town, some soldiers ran
With torches through the midnight, and began
To wrangle for mean raiment, and to throw
Dice for the garments of a wretched man,
Not knowing the god’s wonder, or his woe. 
Wilde clearly bemoaned the philistine 'brawlers of the auction mart' who bargained for Keats' memorabilia.
However, in a cruel irony, ten years later, when Wilde was imprisoned, he too suffered the same fate. His precious literary (and other) belongings were auctioned cheaply at his ransacked home. Included in the sale was a lot listed as 'a Manuscript Poem by Keats, framed' sold off for 38 shillings. No doubt this was the original manuscript of 'Sonnet on Blue' given to Wilde by Emma Speed that Wilde treasured and hung proudly on the wall of his study. Its present whereabouts are unknown.
 'Article: The Tomb of Keats', The Irish Monthly, July 5, 1877, 476-8.
The Grave of Keats.
by Oscar Wilde
Rid of the world’s injustice, and his pain,
He rests at last beneath God’s veil of blue:
Taken from life when life and love were new
The youngest of the martyrs here is lain,
Fair as Sebastian, and as early slain.
No cypress shades his grave, no funeral yew,
But gentle violets weeping with the dew
Weave on his bones an ever-blossoming chain.
O proudest heart that broke for misery!
O sweetest lips since those of Mitylene!
O poet-painter of our English Land!
Thy name was writ in water——it shall stand:
And tears like mine will keep thy memory green,
As Isabella did her Basil-tree.
 The nomenclature 'Sonnet in Blue' is referential, not an actual title. The allusion is to the poem's opening word and its subject which is the color of the sea and the sky. The actual poem may be untitled and goes by the name "Answer to a Sonnet Ending Thus:-", meaning a response to another sonnet by J. H. Reynolds ending: "Dark eyes are dearer far/Than those that mock the hyacinthine bell."
 The Hobby Horse: the magazine ran from 1884–1894 and spanned a total of seven volumes and 28 issues. The Wilde article was in the July 1886 issue, pp 83-6. Reprinted in Miscellanies.
 Letters, 157.
 Dramatic Review, January 23, 1886, 249.