Strictly speaking, compost doesn't have a pH. It's the water that leaches off of the compost, or the compost tea that has hydrogen ions that you can measure and put on the pH scale.

That said, the more rotted it is, the more humic acids that have formed, the more acidic it will be. If the pile went through a lactic acid fermentation, or if you made your compost with something like spoiled silage, you could have an acidic pH down in the 4 range.

It's hard to think of how you could get an alkaline compost, something that after you soak it in water, it measures higher than 8. If you put a whole lot of wood ash on the compost pile, that might bump the pH up.