allenai / s2-folks

Public space for the user community of Semantic Scholar APIs to share scripts, report issues, and make suggestions.
Other
144 stars 25 forks source link

Q: 403 forbidden problem #113

Closed seanxuu closed 10 months ago

seanxuu commented 1 year ago

I received the API key a few hours ago. I tried to use it but I met the 403 problem like https://github.com/allenai/s2-folks/issues/6

Should I apply for a new key?

seanxuu commented 1 year ago

Done. There is a bug in the example code. x-api-key should be X-API-KEY

# Get info about the papers dataset papers = requests.get("http://api.semanticscholar.org/datasets/v1/release/latest/dataset/papers", headers={'x-api-key':os.getenv("S2_API_KEY")}).json()

examples/python/s2ag_datasets/full-datasets.py