Arr Pirates Speculative Fiction?

On November 14, 1883, Robert Louis Stevenson published The Sea Cook: A Story for Boys. You’ve probably never heard of it.
Or rather you have, because it is now better known as Treasure Island, the name under which it was initially serialized in a magazine called Young Folks. Stevenson wrote it under a pen name, Captain George North, to add a layer of authenticity to what pretended to be a real history.
Treasure Island wasn’t the first pirate (or buccaneer, per Stevenson himself) book, of course. The genre can really be traced back to Robinson Crusoe (1719). And there were many other pirate books in the 19th entury, including one by Sir Walter Scott, The Pirate. Scott is, of course, better known for his Robin Hood novel Ivanhoe.
None of these books were serious historical fiction, although Stevenson did draw material from A General History of the Robberies and Murders of the most notorious Pyrates, a 1724 book of biographies of contemporary pirates…but that book too used considerable artistic license.
The truth is that the pirates of Treasure Island and, later, The Pirates of the Caribbean bear little resemblance to any historical reality.
And pirates appear consistently in speculative fiction.