In Chile during the 1840s, Eliza Sommers is a young Chilean girl raised and educated by English Anglican siblings Victorian spinster Rose, strict Jeremy Sommers, and their sailor brother John Sommers, who are expats living in the port of Valparaiso, ever since they found her on their doorstep. She is taught the art of cooking by the Mapuche Indian Mama Fresia.
Over most of Part I, Eliza's origins and upbringing, and her maturity are told. Eliza falls in love with Joaquin Andieta, a young Chilean man who is concerned about his mother who is living in poverty. The young couple have an affair, ultimately resulting in Eliza getting pregnant. Soon, news of gold being discovered in California reaches Chile, and Joaquin goes out to California in search of a fortune. Wanting to follow her lover, Eliza goes to California, with the help of her Chinese zhong yi (physician) friend, Tao Chi'en, in the bowels of a ship headed by a Dutch Lutheran captain, Vincent Katz.
In the beginning of Part II, Tao's past is revealed, from his early life in poverty, to his apprenticeship to a master acupuncturist, and his ill-fated marriage to Lin, a young and pretty, but frail girl who dies after a brief marriage. Lin's spirit later comes in to help her widowed husband at crucial points for Tao in later parts of the book. During the journey to California, Eliza, due to her pregnancy, is frail and sick, and later suffers a miscarriage. To leave the ship without suspicion, Tao disguises Eliza as a Chinese boy, a disguise that she maintains in San Francisco where they have landed. Eliza earns money by selling some Chilean snacks and Tao becomes a successful zhong yi . Tao, after seeing the greed and brothels in San Francisco, loses most of his faith in America. Eliza sets on her journey to find Joaquin, using a male cowboy's disguise and the moniker Elias Andieta, and claiming to be Joaquin's brother. Meanwhile, in Valparaiso, Rose and Jeremy are shocked to find that Eliza has disappeared. When John comes and asks about her whereabouts, Rose reveals a well-kept, shocking secret to Jeremy, a secret that she and John have concealed from him since Eliza's arrival into their home: John is Eliza's father, having had her with an unnamed Chilean woman. Based on intuition, John Sommers sails for San Francisco, commissioned by his wealthy employer Paulina Rodriguez de la Cruz as a steam ship captain, with the additional intent of finding his daughter.
Part III finds Eliza broke after still trying to search for Joaquin; she occasionally sends letters to Tao describing what she sees in her journey. Although she has fallen out of love with Joaquin, she cannot stop journeying. In an outskirt town, Eliza meets up with Joe Bonecrusher's travelling caravan of prostitutes and ends up travelling with them as cook and piano player. The members of the caravan believe Eliza to be a homosexual man, a disguise which she takes up much to the frustration of Babalu, the caravan's bodyguard. Eliza stays with the group during the winter as they settle in a small town. During this time, Tao moves to San Francisco to save up money to move back to China. He surprises himself when he realises that he misses Eliza's company and is consoled when he begins receiving her letters. John Sommers, in his search for Eliza, comes across Jacob Todd, an old suitor of Rose's who is now a journalist known as Jacob Freemont.
Freemont promises that he will look out for any sign of Eliza as he writes articles about the famous bandit Joaquin Murieta, whose description matches Eliza's lover. Meanwhile, as Joe Bonecrusher's business begins to dwindle, Tao finds Eliza and returns to San Francisco with her. They set up a network to help young Chinese prostitutes to escape and rehabilitate with the help of friends. Eventually Jacob Freemont is able to pass word to the Sommers that Eliza, who was previously thought to be dead, is alive. Tao and Eliza live together and eventually form a relationship; she eventually decides to write to Rose to inform her foster mother that she is alive. When Joaquin Murieta is shot dead and his preserved head is showcased in San Francisco, Eliza and Tao go to see if the man was really Joaquin Andieta.