Photoacoustic (PA) imaging holds great promise for preclinical research and clinical practice. However, most studies rely on the laser wavelength in the first near-infrared (NIR) window (NIR-I, 650-950 nm), while few studies have been exploited in the second NIR window (NIR-II, 1000-1700 nm), mainly due to the lack of NIR-II absorbing contrast agents. We herein report the synthesis of a broadband absorbing PA contrast agent based on semiconducting polymer nanoparticles (SPN-II) and apply it for PA imaging in NIR-II window. SPN-II can absorb in both NIR-I and NIR-II regions, providing the feasibility to directly compare PA imaging at 750 nm with that at 1064 nm. Because of the weaker background PA signals from biological tissues in NIR-II window, the signal-to-noise ratio (SNR) of SPN-II resulted PA images at 1064 nm can be 1.4-times higher than that at 750 nm when comparing at the imaging depth of 3 cm. The proof-of-concept application of NIR-II PA imaging is demonstrated in in vivo imaging of brain vasculature in living rats, which showed 1.5-times higher SNR as compared with NIR-I PA imaging. Our study not only introduces the first broadband absorbing organic contrast agent that is applicable for PA imaging in both NIR-I and NIR-II windows but also reveals the advantages of NIR-II over NIR-I in PA imaging.