Ford Repair Questions? Ask a Mechanic for Answers ASAP
The keyless entry key code is programed into the dash fuse box and you will need a scan tool to retrieve it. Ford does not keep it in any databases. They used to print it on a decal on the back side of the dash fuse box, or in the older vehicles, it was printed on the Vehicle Security Module. But your 2005 Freestyle has everything incorporated inside the dash fuse box that Ford now calls the Smart Junction Box or SJB which is mounted under the drivers side of the dash.
Any Ford/Lincoln dealership service department can get it for you from your vehicle, but they will have to hook their scan tool to the vehicle to do it.