It would be illegal to buy it from eBay, as Apple never offered it for sale in any way except via a download from the App Store. The eBay version would be digitally Signed by the person that downloaded it. You need their Apple ID to perform updates.
As others have been trying to say, if you ever used the Applications -> App Store to download Mavericks, then if you look in the App Store -> Purchases tab, you should be able to download it again.
If you never downloaded Mavericks, then it is no longer available for sale.
You could try making a Genius Bar appointment at an Apple store and see if they will install Mavericks. This may or may not work.
In the future, I suggest you always download, and then "Quit" the install of every Major OS X (soon to be macOS) release, if you wish to have the option to install that release in the future. You should do that "Now" for El Capitan, as there is a very good changed we are just days a way from the release of Sierra, and history says at that point, El Capitan will be removed from the App Store. Again, if you have downloaded an OS release from the App Store, it will be in your App Store -> Purchases tab going forward. Keep you options open, by doing a download for each Major OS X release..