To enhance the energy harvesting capabilities of optoelec tronic devices, it is necessary to achieve both broadband and targeted photodetectionwith improved sensitivity. To address the limitations of photodetection, the combinationof small band gap semiconductorswith large band gap 2D semiconductors has been found to offer additional benefits. Specifically, two-dimensional (2D)vanderWaalsheterostructures withcustomizedbandalignment have gained significant attentiondue to their potential advantages. The relation between the built-in field and optoelectrical properties of suchheterostructures is not fully understood. Here,ahighlysensitiveair-protectedphototransistordevicebasedonvander Waals heterojunctionbetween few-layer blackphosphorus (BP) and few layergraphdiyne(GDY)hasbeenproposed.Blackphosphorus(BP),withits smallanddirect tunablebandgap, complementsthespectral rangebetween graphene and TMDCs and offers extraordinary electrical and mechanical properties. The optoelectrical properties and photodetectionmechanismhavebeen investigatedunderUVto IRwavelengths alongwith the computationalmethods. The BP/GDYFETphotodetector presents ambipolar behaviorwithmobilities in theorder of 1656.3and804.271cm2/(V·s), for electronandhole, respectively,andcurrenton/offratioslargerthan1.19×104.Besides, thedevicedemonstratesthehighandgate controlledphotoresponsivityofR=1267.43and3041.82AW−1acrossarangeofwavelengths(λintherangeof395−940nm)in UVandnear-infraredregions,respectively.Furthermore, theBP/GDYphototransistordeviceshowsatimeresponseof19ms(rise) and6ms(fall).Thisstudyhighlightsasignificant improvement inthephotovoltaicpropertieswithintheultravioletandinfrared spectraandahighenergyconversionefficiencyforheterojunctionsbasedonfew-layer2Dmaterials.Thisgroundbreakingdesignhas asignificantpotential torevolutionizethefieldofoptoelectronicsbyenablingthecreationofexceptional infraredphotodetectors withoutstandingperformance.