The American Petroleum Institute (API) reported a substantial build in US crude oil inventories for the week ending June 26, with stocks rising.