Sarafina and the Pirate's Spyglass
Sarafina and the Pirate's Spyglass (book 1) by Jaye Helm
Upon discovery of a rare antique box, Sarafina uncovers an ancient spyglass that transports her back to the 18th-century where she meets scallywags bearing cutlasses, who sail aboard tall ships that bear an unusual black flag. But when she is suddenly kidnapped, she must quickly use her cunning to survive the adventures of the Spanish Main before the spyglass is lost and she is forced to live the rest of her life at sea as a pirate.
YA appropriate book