It’s free for all SRD materials (anything in the basic starter set) but anything beyond that you have to buy the digital book through D&D Beyond (not from anywhere else). You can do it piecemeal so it’s not too bad but as someone who owns some of the books it’s a little irksome.