1998 toyota camry high rpm's

I have a 1998 toyota camry , whenever I start it after its been sitting for 3 or more hours the rpm’s shoot up to
2,000 and stay there for 3-4 minutes straight, if I hit the gas they don’t go down, if I turn my heat on they come down a little bit, any help

One of the things to check is a defective Idle Air Control valve. http://www.rockauto.com/catalog/moreinfo.php?pk=946014&cc=1317483 The IAC valve controls the engine idle speed.

Locate the IAC valve on the throttle body. Start the engine and while the engine is idling high take the handle of a screwdriver and tap on the IAC valve. If the idle speed changes replace the IAC valve.

Tester

I agree with @Tester about this. I had to replace one on a 96 Chrysler Town and Country and it fixed the problem. The real issue was taking the gamble, because the part was pretty expensive and could not be returned. But, since it does idle down after a while, this is probably the problem. Not definitely, probably.

You might also check and/or replace the Coolant Temperature Sersor. This is the sensor that communicates the engine temperature to the Engine Control Module. If this is going open, i.e infinite resistance, when cold the ECM will command high engine idle until the resistance drops. If you have access to a DVM measure the resistance of the sensor when cold and compare the reading to the table in the Service Manual. Do not mistake the CTS for the temperature sensor for the dash gauge as these are in approximately the same location.

Hope this helps.