Using the github API, you can get a repository tree using (example done with CURL):
curl https://api.github.com/repos/{owner}/{repo}/git/trees/{tree_sha}