Pregnancy Tests?

Hey guys, so I know this is probably a silly question, but I was just wondering how soon you should take a pregnancy test after having unprotected sex? I heard 3 weeks was the norm because that's how long it usually takes for the hormones in your body to cause the color on the test to change,but I was wondering if there were any tests that were accurate and can be used sooner than 3 weeks? Thanks in advance.