Hello and thanks for using Just Answer.I will try my best to help you with your question.
There are three ways to get the factory code for the keyless entry system keypad.
One would be the factory card that came with the vehicle that will have the 5 digit code from the factory which cannot be erased and is permanent to the module. It should be with the owners manual package.
The second way is to stop by any dealership and have them access the code for you with their scan tool we call IDS. They may charge you to hook the scan tool up and get the code.
The third way is to remove the dash fuse box behind the passenger side kick panel under the passenger side of the dash. There is a sticker on the back side of the fuse box (Ford calls it the BCM Body Control Module).
There will be a sticker on the back side of the BCM with a 5 digit code which is the factory key code.