0

w.r.t to this post: GitHub API: Number of Stars of a Repository Over Time I'm trying to do the same in python, here is the code snippet:

import requests
url = "https://api.github.com/repos/flutter/flutter/stargazers?per_page=1"
repo_response = requests.get(url,headers={'Accept': 'application/vnd.github.v3+json'})
print(repo_response.json())

According to the Git API documentation, I've sent the accept in headers but I still fail to get the "Alternative response with star creation timestamps". The result is that of a default response.

Is there something that I'm missing out here?

1 Answer 1

0

I guess you forgot to add something in header (application/vnd.github.v3.star)

repo_response = requests.get(url,headers={'Accept': 'application/vnd.github.v3.star+json'})
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.