You don't need to buy anything to play here on Roll20. There are some great in-game benefits to purchasing those books on this platform, but as long as you're good at typing, you can manually make character and NPC sheets and abilities on them. Anything from the SRD (free, open licensed content offered by Wizards of the Coast) will be available to you in the in-game compendium. If you're using a compatible character sheet (like the D&D 5th Edition by Roll20) you can drag any spells or items listed in the compendium from there to a character's sheet and you won't need to type anything for that. Anything not listed there (many spells specific to Druids, Paladins, and Warlocks, for example) will need to be recreated manually on the sheet. Many monsters are available in the compendium as well, and can be dragged out to create character sheets for them. There are not, however, pictures for them, so you'll need to provide your own.