What year used or rebuilt engines can I replace my Dodge Ram 1500 V-8's with? on 1999 Dodge Ram 1500

My 1999 Dodge extended cab Ram 1500 5.2 v-8 has a lot of miles on it and is using/burning a lot of oil. Was wondering if I should try to start looking for a used,or rebuilt engine, and what years, etc. should I look for to replace it.

Asked by for the 1999 Dodge Ram 1500
94-01 should be able to go in it. but make sure they have the same engine VIN number. i think its the fifth character and the 5.2 is a x i think, but dont quote me on that part.