The detection and analysis of rare blood biomarkers is necessary for early diagnosis of cancer and to facilitate the development of tailored therapies. However, current methods for the isolation of circulating tumour cells (CTCs) or nucleic acids present in a standard clinical sample of only 5-10 ml of blood provide inadequate yields for early cancer detection and comprehensive molecular profiling. Here, we report the development of a flexible magnetic wire that can retrieve rare biomarkers from the subject's blood in vivo at a much higher yield. The wire is inserted and removed through a standard intravenous catheter and captures biomarkers that have been previously labelled with injected magnetic particles. In a proof-of-concept experiment in a live porcine model, we demonstrate the in vivo labelling and single-pass capture of viable model CTCs in less than 10 s. The wire achieves capture efficiencies that correspond to enrichments of 10-80 times the amount of CTCs in a 5-ml blood draw, and 500-5,000 times the enrichments achieved using the commercially available Gilupi CellCollector.