The calculated distance (air line) between Apiaí and Sorocaba is approximately 112 miles respectively 180 kilometers.
By car or train, the actual journey to Sorocaba is certainly longer, as only the direct route (as the crow flies) between Apiaí and Sorocaba has been calculated here.