The donor-acceptor semiconducting polymers (SPs) have robust absorbance in near-infrared (NIR) region, great photostability, high photothermal conversion efficiency, and good biocompatibility. Thus, the SPs exhibit great potentials for photothermal therapy (PTT) and photoacoustic imaging (PAI). However, poor understanding of the underlying mechanisms and the correlation between the SP polymer chemical structures and their performances of PTT and PAI have significantly hindered their biomedical application. Herein, a series of acceptor-π-acceptor type (A1-π-A2) type SPs were synthesized. The diketopyrrolopyrrole (DPP) and thiophene are used as A1 electron accepting block and π-bridge, and the chemical structure of A2 unit was variable. The SPs were formulated into PEGylated nanoparticles, which ensured these SP-based nanoparticles (SP@NPs) exhibited similar size, shape, and physiological stability. Thus, the chemical structure of A2 unit was the only variable. The effects of the SP chemical structures are carefully and comprehensively evaluated through both in vitro and in vivo experiments. Our results demonstrated the chemical structure of A2 unit simultaneously impact their absorption spectra and photothermal (PT) conversion efficiency, which finally determined their PTT and PAI performances. Among these A2 acceptors, thieno[3,2-b]thiophene (TT) unit exhibited the best in vitro and in vivo anticancer efficacies and PAI performances. This study not only provides molecular insights into the design of efficient SPs for PTT and PAI but also highlights the flexibility and potential of SP@NPs for biomedical application. Thus, SP@NPs can act as a versatile nanoplatform for the development of novel light intensive imaging and therapeutic approaches.