Git Product home page Git Product logo

valorapi's Introduction

ValorAPI

Info

This is a wrapper for the Valorant API ran by Hendrik.

You do not need an API key to use this wrapper, it is rate limited to 30 requests per minute. Other status codes are also listed in the API documentation.

I have created this wrapper to have easy access to valorant api. I will be adding more endpoints as I go. But for now, I have only added the basic endpoints.

For big scale projects, I would recommend using the official API by Riot Games.

Api Endpoints

All the endpoints are listed in the API Documentation here

Contributing

If you would like to contribute to this project, please feel free to do so. I will be happy to accept any pull requests after reviewing them. If you have any suggestions or issues, please open an issue.

Beta

This project is still in beta, so there might be some bugs. If you find any, please open an issue. This might take a while until I find it suitable for production. So as long as we don't reach v1 you should consider this as a beta project. At this stage, even minor updates might break your code. So please be careful when updating.

Usage

Try to use this wrapper in a try-catch block to catch any errors that might occur. Communication with the API is done via HTTP requests, so there might be some errors that you can catch. Errors based on the API give an errors object in the response. You can check if the errors object is not null to see if there are any errors. Some examples are:

  • 101: No region found for this Player
  • 102: No matches found, can't get puuid
  • 103: Possible name change detected, can't get puuid. Please play one match, wait 1-2 minutes and try it again
  • 104: Invalid region
  • 105: Invalid filter
  • 106: Invalid gamemode
  • 107: Invalid map
  • 108: Invalid locale
  • 109: Missing name
  • 110: Missing tag
  • 111: Player not found in leaderboard

for more errors, please check the API documentation.

CommonJS:

const { ValorantUser } = require('valorapi')
const User = new ValorantUser('ypsilontm', 'euw', Affinities.Eu)
const account = await User.getAccount()
if (account.status === 200) {
  const name = account.data?.name
  // Do other things...
}

ES6:

import { ValorantUser } from 'valorapi'
const User = new ValorantUser('ypsilontm', 'euw', Affinities.Eu)
const account = await User.getAccount()
if (account.status === 200) {
  const name = account.data?.name
  // Do other things...
}

Current Available methods

  • getMMR()
  • getContent()
  • getMatches()
  • getMatchesLifetime()

valorapi's People

Contributors

ypsilontm avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.