Is there any api for get projection matrix of camera?

For other SDK, projection matrix is a property of camera:

How to get it from ruby API of Sketchup?

I think SketchUp doesn’t expose its internal projection matrix directly to users or the Ruby API, but you can check Camera properties like FOV, aspect ratio, and perspective/parallel … etc.

You can also check the View class and its methods to manipulate the current point of view of the model. (like e.g. #screen_coords method transforming 3D coordinates into 2D screen coordinates)

You can get camera using the view.camera, so you can manipulate these camera parameters for current view.

You can get it using a C Ruby extension via the C API:

SUCameraGetViewTransformation()