Beginning with the first year for the ST (2001) the only engine available was the 4.0L SOHC. At some point later a V8 was available, but I don't know when and I assume it was the 4.6L.
I recommend staying away from the 4.0L SOHC V6's due to all the timing chain issues most have. On the 4.6L V8 there was an issue with the weird long-shank 2-piece spark plugs breaking off. Later Ford went to a 1-piece spark plug to eliminate the plugs breaking during removal.
If I were to buy another ST I'd get one with the V8 engine, as new a model as I could afford. I like my '01 ST, but it's been nothing but problems since I bought it. I don't know what the first year was for the V8 ('05?). Later models also had rear disc brakes and independent rear suspension.
The list of repairs I've had to make to my ST is multi pages long and 3-years later is ongoing. One thing that most older ST's need is new body mount bushings. I recommend Prothane brand replacements bushings for the OE foam bushings (which suck and are ridiculously expensive).
Be prepared to pay a premium for an ST (for no reason other than it has a bed on the back). Typically used ST's are at least twice the cost of a regular Explorer.