You can change the "segment" to get a higher number of "hair_keys". 

[![Hair Segment Input Field][1]][1]

In script, you can use bpy.data.particles["ParticleSettings"].hair_step = n,
where n is the segment number, which is len(hair_keys) - 1


  [1]: https://i.sstatic.net/s7ZVc.png