1

So I've been trying valorantpy module that provides an easy way to send requests to get personal player statistics.

This code:

import os
import valorant

KEY = 'key'
client = valorant.Client(KEY, locale="ru-RU", region="eu", route="europe")

account = client.get_user_by_name("SGT ItsRazyHero#VCTRU")
match = account.matchlist().history.find(queueId="competitive")

if match == None:
    print("No Ranked match in recent history!")
    exit(1)
else:
    match = match.get()

for team in match.teams:
    print(f"{team.teamId} Team's Ranks: ")

    players = match.players.get_all(teamId=team.teamId)

    for player in players:
        print(f"\t{player.gameName} - {player.rank}")

Checks my latest competitive match and gets information about teammates and their ranks. So I've got trouble.

requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://eu.api.riotgames.com/val/match/v1/matchlists/by-puuid/C3NUBHHFqy-JaV_losaGX0s_-q-NszM5VGYyHHV8GhFMVffm9GhknMFaCiY5GxPLdQ6L_cDYUQol9A?locale=ru-RU

And I don't know how to solve this problem. If you follow this link you will get 401 Unauthorized error.

Razy
  • 11
  • 1

1 Answers1

1

If you're using a temporary Development API key, it won't work cause you are not authorized to fetch match history. You can find a list of accessible APIs that work on a Development API key by logging in to developer.riotgames.com and going to the APIS page.

Solution: You need to register your product and get the Production API key or the Personal API key (the choice is yours, depending upon your requirements). You can do this by logging in to the above site and registering your product.

chirag_9121
  • 11
  • 1
  • 4