I don't know I you already tried looking on Google, but this a problem multiple persons have tried to do. 

There doesn't seems to be a Public API (yet ?) also no "private" API has been found yet. 

Also, as stated in [this question][1], MacBooks have intelligent battery management. This means your laptop will stop charging once the battery is full. 
_____

Edit : 

Results I found : 

* [SO question : Is there a way to turn off battery charging programmatically in OSX?][2]
* [Mac Rumors topic : Make battery stop charging at a certain level][3]
* [Mac rumors topic : Program to disable charging][4]
* [Ask Different question : How to disable battery charging?][5]


  [1]: http://apple.stackexchange.com/questions/12271/should-i-disconnect-my-macbook-pros-power-cord-when-the-battery-is-fully-charge
  [2]: http://stackoverflow.com/questions/19168214/is-there-a-way-to-turn-off-battery-charging-programmatically-in-osx
  [3]: http://forums.macrumors.com/showthread.php?t=862619
  [4]: http://forums.macrumors.com/showthread.php?t=1667538
  [5]: http://apple.stackexchange.com/questions/87924/how-to-disable-battery-charging/132332#132332