Your best bet is to bake the texture. That is what cycles is doing in the background. I think it even uses the same basic code design as the displacement modifier.
There is no API access to this.
If you need to bake to an object that isn’t UV’d, take a look at the script I wrote for this purpose: Using Python to bake displacement for Cycles— How does Cycles displace a point?