1998 Nissan Frontier - Floppy fuel door

fuel door flopping,doesnt stay flush with body

Hinge or latch problem. Any good body shop should be able to repair.

most likely the spring failed and needs to be replaced. here is a cheap temporary way to keep it closed until it is repaired correctly

https://www.bing.com/videos/search?q=how+to+fix+fuel+door+latch+on+a+1998+Nissan+Frontier&&view=detail&mid=DF6F6FBAFC0AD7627904DF6F6FBAFC0AD7627904&&FORM=VRDGAR&ru=%2Fvideos%2Fsearch%3Fq%3Dhow%2Bto%2Bfix%2Bfuel%2Bdoor%2Blatch%2Bon%2Ba%2B1998%2BNissan%2BFrontier%26go%3DSearch%26qs%3Dds%26form%3DQBVR

But where to get spring, I’ve had no luck.

Being your vehicle is so old your best bet is to go to an auto salvage yard.
you will probably have to buy the whole fuel door. you can call around to auto salvage yards and ask if they have it. you may get lucky and find one in your vehicles color. if a particular salvage yard does not have it, they can usually look on their computer at other salvage yards and find one for you.

@KimGreen30 Just put ( 1998 Nissan Frontier fuel door spring ) in Google and you will see that the spring can be found . You may have to call to make sure they have the correct one.

It took less then a minute to see several places that might have one.