How do you determine which position a block is in the blockchain? I want to create a difficulty calculator and need to know when each 2016th block has been created and how many blocks were created in the previous two weeks.

Do I have to count and label each block from the genesis block up manually or is there an easier way without having to download and parse the entire blockchain or use an external service?
To find the height of a block with only the raw blockchain (or block header) data, you need to follow through the sequence of references all the way to the genesis block.

Of course, there are external services offering this information in their API.

As for your premise, to calculate difficulty you don't need to know how many blocks were created in two weeks, only how much time passed for 2016 blocks (or actually 2015 blocks due to an off-by-one bug).