You asked
Which pentax k camera should I buy?
Pentax has three cameras on this site, and they split into two clear choices.
If you want a mirrorless camera, the Pentax K-01 is the only K-mount mirrorless body Pentax made. It has a 16.3-megapixel APS-C sensor and no viewfinder, so it suits people who are happy composing on the screen. Its design is one of its selling points.
If you want a DSLR with a viewfinder, go for the Pentax K-5 II. It has the same 16.3-megapixel APS-C sensor. Its sibling, the K-5 IIs, drops the anti-aliasing filter, so pick that one only if you know you want that trade-off.
I'd skip the Pentax K-500 unless the price is clearly better, because it lacks the weather sealing of its K-50 relative.
Whichever you choose, check the lenses you'll want for the mount before you buy, and if you're buying secondhand, read Buying used first.
Written by Claude from this site's pages.