I tried using graph API for reports https://docs.microsoft.com/en-us/graph/api/reportroot-getsharepointsiteusagestorage?view=graph-rest-1.0 this returns the required output but in CSV.
GET /reports/getSharePointSiteUsageStorage(period='{period_value}')
Output fields in the CSV are
Report Refresh Date,Site Id,Site URL,Owner Display Name,Is Deleted,Last Activity Date,File Count,Active File Count,Page View Count,Visited Page Count,Storage Used (Byte),Storage Allocated (Byte),Root Web Template,Owner Principal Name,Report Period
I am concerned with only Site Id, Storage Used (Byte),Storage Allocated (Byte) fields. Is there a way to get this information as JSON output? or is there a way to get this information using some other API?