Get file contents contained in a repository programatically in Python

I have marketplace product name, fetched using REST endpoint in python. I want to fetch package.json file contents from code repository using marketplace product name programmatically in python.

is there any REST endpoint available or need to use foundry/platform sdk? please share an example.

I went through multiple documentation on website and some forums but didnt find the answer.