frissyn / valorant.py

Complete Python interface for the Valorant API. Works right out of the box!
https://valorantpy.readthedocs.io
MIT License
125 stars 19 forks source link

403 forbidden #36

Closed Stift007 closed 2 years ago

Stift007 commented 2 years ago
import valorant

KEY = "my personal api key"
client = valorant.Client(KEY)

agents = client.get_characters()

print(agents.get("Viper"))

Returns

Traceback (most recent call last):
  File "c:/Users/clyde/Documents/disco/main.py", line 11, in <module>
    client = valorant.Client(KEY)
  File "C:\Users\clyde\AppData\Local\Programs\Python\Python38\lib\site-packages\valorant\client.py", line 71, in __init__
    self.get_content(cache=True)
  File "C:\Users\clyde\AppData\Local\Programs\Python\Python38\lib\site-packages\valorant\client.py", line 181, in get_content
    content = self._content_if_cache()
  File "C:\Users\clyde\AppData\Local\Programs\Python\Python38\lib\site-packages\valorant\client.py", line 81, in _content_if_cache
    return ContentDTO(self.handle.call("GET", "content"))
  File "C:\Users\clyde\AppData\Local\Programs\Python\Python38\lib\site-packages\valorant\caller.py", line 52, in call
    r.raise_for_status()
  File "C:\Users\clyde\AppData\Local\Programs\Python\Python38\lib\site-packages\requests\models.py", line 960, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://na.api.riotgames.com/val/content/v1/contents?locale=de-DE
frissyn commented 2 years ago

A 403 Forbidden error usually means that your API key is invalid or expired. Try generating a new one from the portal and see if that works.

frissyn commented 2 years ago

Closing due to inactivity!