How to get this information from a material?



I found if you exchange the skp file to a OBJ file ,it will also create a mtl file which describe the material,
such as the text below

Wavefront material file

Converted by the DEEP Exploration

Right Hemisphere, LTD

newmtl inside
Ka 0.4 0.4 0.4
Kd 0.587609 0.587609 0.587609
Ks 0.071744 0.071744 0.071744
Ns 32

newmtl outside
Ka 0 0 0
Kd 1 1 1
Ks 0.384296 0.194061 0.174387
Ns 64
map_Kd cup.jpg

and below is the explanation of Ka,Kd,Ks,map_Kd
Ka:Ambient Color

Kd:Diffuser Color

Ks:Specular Color


map_Kd:the picture of Diffuse

and I wanna know how to get these data?
and another question is whether there are some sdk which could support api to write into obj file and mtl file?
thanks for your help!