This is an API wrapper for valorant-api.com. This API is separate from the in-game APIs and is managed by a third party.
First you need to import the ContentAPI module and the Language Module.
const { ContentAPI, Languages } = require("@liamcottle/valorant.js");
Next, you need to create a ContentAPI instance. You can optionally provide the Language the data should be returned in. By default, the language is set to English. Here is a list of all available languages:
Languages |
---|
German |
English |
Spanish_Spain |
Spanish_Mexico |
French |
Indonesian |
Italien |
Japanese |
Korean |
Polish |
Portuguese_Brazil |
Russian |
Thai |
Turkish |
Vietnamese |
Chinese_Simplified |
Chinese_Traditional |
const content = new ContentAPI(Languages.English);
After you have created the ContentAPI instance you can start fetching data. For this you can either use async/await or .then this works as follows: Async/Await:
//Send a request to get all agents
const data = await content.getAgents();
//Log the received data in the console
console.log(data);
.then
content.getAgents().then((data) => {
//log data
console.log(data);
});
Here is an example of how to get a players' Daily Store and then fetch the Asset Data using the ContentAPI.
// import modules
const { API, ContentAPI, Languages, Regions } = require("@liamcottle/valorant.js");
// initiate the API and the ContentAPI Module
const client = new API(Regions.EU);
const content = new ContentAPI(Languages.English);
// authorize using the ClientAPI
client.authorize("username", "password").then(() => {
client.getPlayerStoreFront(client.user_id).then(async (response) => {
// get assets for the first Skin in the Store
const item1 = await content.getWeaponSkinLevelByUuid(
response.data.SkinsPanelLayout.SingleItemOffers[0]
);
// log item
console.log(item1);
});
});
Here is a list of all available Endpoints for the ContentAPI:
- Agents
- getAgents()
- getAgentsByUuid(uuid)
- Buddies
- getBuddies()
- getBuddyLevels()
- getBuddyByUuid(uuid)
- getBuddyLevelByUuid(uuid)
- Bundles
- getBundles()
- getBundleByUuid(uuid)
- Ceremonies
- getCeremonies()
- getCeremonyByUuid(uuid)
- Competitive Tiers
- getCompetitiveTiers()
- getCompetitiveTierByUuid(uuid)
- ContentAPI Tiers
- getContentTiers()
- getContentTierByUuid(uuid)
- Contracts
- getContracts()
- getContractByUuid(uuid)
- Currencies
- getCurrencies()
- getCurrencyByUuid(uuid)
- Events
- getEvents()
- getEventByUuid(uuid)
- Gamemodes
- getGamemodes()
- getGamemodeEquippables()
- getGamemodeByUuid(uuid)
- getGamemodeEquippableByUuid(uuid)
- Gear
- getGear()
- getGearByUuid(uuid)
- Maps
- getMaps()
- getMapByUuid(uuid)
- Player Cards
- getPlayerCards()
- getPlayerCardByUuid(uuid)
- Player Titles
- getPlayerTitles()
- getPlayerTitleByUuid(uuid)
- Seasons
- getSeasons()
- getCompetitiveSeasons()
- getSeasonByUuid(uuid)
- getCompetitiveSeasonByUuid(uuid)
- Sprays
- getSprays()
- getSprayByUuid(uuid)
- Themes
- getThemes()
- getThemeByUuid(uuid)
- Weapons
- getWeapons()
- getWeaponSkins()
- getWeaponSkinChromas()
- get WeaponSkinLevels()
- getWeaponByUuid(uuid)
- getWeaponSkinByUuid(uuid)
- getWeaponSkinChromaByUuid(uuid)
- getWeaponSkinLevelByUuid(uuid)
If you have any Issue or Suggestion please open an Issue on the Github Repository or join the Discord Server