Need assistance with how can I read apex class lines? which API should I use for accomplishing this REST or SOAP? Please help.
Hitting endpoint ->
will give the list of classes and we can check the content of the apex class using its body attribute.
As @sfdcfox specified in the above conversation body of classes from managed packaged will be hidden.