valorant.py: A Valorant API Wrapper for Python

Posted by Steve

Friday, December 18, 2020 11:48 AM

valorant.py: A Valorant API Wrapper for Python

Scrolling through the Valorant subreddit, I haven't seen a lot of Valorant-related programming projects/posts (there's like, 2 :P) so I decided to share one that I made recently: valorant.py.

It's an API wrapper package written in Python for the rito's Valorant endpoints. It can get all kinds of information from the API and return them as intuitive Python objects for easy use! Right now, it's still in beta, so you can't get match data yet, but you can get agents, chromas, skins, maps, game modes, etc. with valorant.py. (if you have an api key, ofc)

For example, if you wanted to get a list of all the base Vandal skins you could write:

import valorant

client = valorant.Client('RGAPI-key-goes-here')
skins = client.get\_chromas()

print('All the base Vandal skins:\n')

for skin in skins:
    s = skin.name
    if 'Vandal' in s and 'level' not in s:
        print(s)

that will print out a list like this:

All the base Vandal skins:

Aristocrat Vandal
Elderflame Vandal
Hivemind Vandal
Ruin Vandal
Dot EXE Vandal
Prime Vandal
Avalanche Vandal
Luxe Vandal
Sensation Vandal
Sakura Vandal
Revear Vandal
Vandal
Ego Vandal
Wasteland Vandal
Winterwunderland Vandal

If you're interested in checking out the source code, you can find it at the valorant.py repository on GitHub, and the documentation is there as well. Thanks for checking this out, and I hope you can make some cool stuff with valorant.py!

References

  • https://www.reddit.com/r/VALORANT/comments/kf4nvo/valorantpy_a_valorant_api_wrapper_for_python/
  • https://reddit.com/kf4nvo

More Like This