import requests gitlab_pat = 'glpat-mJPdjrPiHCTj2NqNZN_m' headers = {'PRIVATE-TOKEN': gitlab_pat} r = requests.get('https://gitlab.ekeepa.co/api/v4/projects/10/repository/commits?path=src/services/v2/site/rooms/[id]/service.GET.ts', headers=headers) commits = r.json() print("Number of commits:", len(commits)) for c in commits: print(c['id'], c['title'], c['created_at'])