There are some programs that can search your computer to find the product keys. Normally when a computer comes from the store with Windows 8.1 installed on it, the computer is already activated. Like many OS for windows, you can install the OS without a product key and they give you 30 days to use this before they require you to buy the product key. but what people don't realize is that the OS will continue to work even when the 30-day trial period ends.
Some sites online will say that you can activate this key or that key for free, but this isn't the case. The keys they offer you have been used by too many people in the past and Windows has blacklisted them on their servers and won't allow you to use these codes again. Personally, I have never used Windows 8.1 because of all the issues with the OS and the problems that it has. It is best to find a legitimate copy of Window 7 with SP1 and activate this. Afterward, go to the Windows site and upgrade to Windows 10. Microsoft has stated that Windows 10 will be the last OS that they release and all they will do is give updates to the OS. Even if you find a way to activate this OS it will expire just like Windows XP and they will no longer support this.
I would suggest that you ask a friend for a disk of Windows 7 with SP1 and install this on your computer. There is an article out there that explains that Microsoft will still allow you to upgrade to Windows 10 for free. Find this article and follow the link. You do need SP 1 on your system in order for this to work. I know this is valid because I have done this recently for a few computers here.