### Get RuneScape Player Avatar and Total Users using runescape-api Source: https://context7.com/elian-argentics/runescape-api/llms.txt Fetches a player's avatar URL and the total number of RuneScape accounts. Includes an example of a player lookup function combining avatar and hiscores data. ```javascript const rs = require('runescape-api'); // Get player avatar URL rs.miscellaneous.getAvatar('Zezima') .then(avatarUrl => { console.log(`Avatar URL: ${avatarUrl}`); // Use this URL in your application to display the player's avatar }) .catch(error => { console.error('Error fetching avatar:', error.message); }); // Get total RuneScape accounts rs.miscellaneous.getTotalUsers() .then(totalAccounts => { console.log(`Total RuneScape Accounts: ${totalAccounts.toLocaleString()}`); }) .catch(error => { console.error('Error fetching total users:', error.message); }); // Example: Create a Discord bot command for player lookup async function playerLookup(playerName) { try { const [player, avatar] = await Promise.all([ rs.hiscores.getPlayer(playerName), rs.miscellaneous.getAvatar(playerName) ]); return { name: player.name, totalLevel: player.skills.overall.level, avatarUrl: avatar }; } catch (error) { console.error('Player lookup failed:', error.message); return null; } } ``` -------------------------------- ### Get Beasts by First Letter Source: https://github.com/elian-argentics/runescape-api/blob/master/docs/bestiary.md Retrieves a list of all beasts whose names start with a specified letter. This is useful for searching or filtering beasts alphabetically. ```APIDOC ## GET /beasts/by-letter/:letter ### Description Lists all beasts starting with a given letter. ### Method GET ### Endpoint `/beasts/by-letter/{letter}` ### Parameters #### Path Parameters - **letter** (string) - Required - The first letter of the beast name to search for. ### Response #### Success Response (200) - **Array** - An array of beast objects, each containing `label` (name) and `value` (ID). ### Response Example ```json [ { "label": "Cabbage", "value": 22836 }, { "label": "Cabbage archer (0)", "value": 21455 }, { "label": "Cabbagemancer (105)", "value": 25157 }, { "label": "Cabbageomancer (0)", "value": 21456 }, { "label": "Cabin boy", "value": 4539 }, { "label": "Cadarn herald", "value": 19857 } ] ``` ``` -------------------------------- ### Get Weaknesses (JavaScript) Source: https://github.com/elian-argentics/runescape-api/blob/master/docs/bestiary.md Fetches a list of all possible weaknesses that beasts can have. This function does not require any parameters and returns a promise that resolves to an array of Weakness objects. ```javascript bestiary.getWeaknesses().then(data => { console.log(data) }) ``` -------------------------------- ### Grand Exchange - Get Item Details and Price Trends Source: https://context7.com/elian-argentics/runescape-api/llms.txt Retrieve detailed information about Grand Exchange items including current prices, price trends, and historical data. ```APIDOC ## Grand Exchange - Get Item Details and Price Trends ### Description Retrieve detailed information about Grand Exchange items including current prices, price trends, and historical data. ### Method `GET` (Implicitly via library function) ### Endpoint `N/A` (Handled by the library) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```javascript const rs = require('runescape-api'); // Get item details by ID rs.grandexchange.getItem(4151) // Abyssal whip .then(item => { console.log(`Item: ${item.name}`); console.log(`Description: ${item.examine}`); console.log(`Members: ${item.members}`); console.log(`Category: ${item.category.name}`); console.log(`Current Price: ${item.trends.current.price}`); console.log(`Current Trend: ${item.trends.current.trend}`); console.log(`Today's Change: ${item.trends.today.price}`); console.log(`30-day Trend: ${item.trends.day30?.trend}`); console.log(`Icon URL: ${item.icons.large}`); }) .catch(error => { console.error('Error fetching item:', error.message); }); // Get price graph data rs.grandexchange.getItemGraph(4151) .then(graph => { console.log(`Item ID: ${graph.id}`); console.log('Daily prices:', graph.daily); console.log('Average prices:', graph.average); // graph.daily is { "1609459200000": 2500000, ... } - timestamp: price }) .catch(error => { console.error('Error:', error.message); }); ``` ### Response #### Success Response (200) - **name** (string) - The item's name. - **examine** (string) - The item's description. - **members** (boolean) - Whether the item is members-only. - **category** (object) - Object containing category information, with a 'name' property. - **trends** (object) - Object containing price trend data. Includes 'current' (price and trend), 'today' (price change), and 'day30' (30-day trend). - **icons** (object) - Object containing icon URLs, with a 'large' property. #### Response Example ```json { "id": 4151, "name": "Abyssal whip", "description": "<col=000000>A whip made from the tentacle of an abyssal demon.<br>It's incredibly powerful.<col=ffffff>", "members": true, "limit": 10000, "actions": [ "Check price", "Buy", "Sell" ], "category": { "id": 1, "name": "Weapon" }, "icon": "https://services.runescape.com/m=itemdb_rs/4435/viewitempic.gif?icon=4151", "largeIcon": "https://services.runescape.com/m=itemdb_rs/4435/viewitempiclarge.gif?icon=4151", "trends": { "change": "-1086", "price": "2490000", "trend": "-0.04%", "current": { "price": "2490000", "trend": "-0.04%" }, "day30": { "price": "2500860", "trend": "-1.75%" }, "day90": { "price": "2535860", "trend": "-4.58%" }, "day180": { "price": "2616860", "trend": "-7.16%" } }, "today": { "price": "-26860", "trend": "-1.07%" } } ``` ``` -------------------------------- ### Get Beasts by First Letter (JavaScript) Source: https://github.com/elian-argentics/runescape-api/blob/master/docs/bestiary.md Retrieves a list of all beasts whose names start with a specified letter. It takes a single string parameter 'letter'. The function returns a promise that resolves with an array of beast objects. ```javascript bestiary.getBeastsByFirstLetter("c").then(data => { console.log(data) }) ``` -------------------------------- ### Get Monthly XP Source: https://github.com/elian-argentics/runescape-api/blob/master/docs/runemetrics.md Retrieves a user's monthly experience gained in a given skill. Requires the player's name and the skill ID. ```APIDOC ## GET /runemetrics/monthlyxp ### Description Retrieve a user's monthly experience gained in a given skill. ### Method GET ### Endpoint /runemetrics/monthlyxp ### Parameters #### Query Parameters - **playerName** (string) - Required - The name of the player. - **skillId** (number | Skill) - Required - The ID or Skill object for the desired skill. ### Request Example ```json { "playerName": "Conundrum129", "skillId": 19 } ``` ### Response #### Success Response (200) - **skill** (object) - Information about the skill. - **id** (number) - The ID of the skill. - **name** (string) - The name of the skill. - **totalExperience** (number) - The total experience accumulated in the skill. - **totalGain** (number) - The total experience gained in the skill over the period. - **monthData** (array) - An array of objects, each representing monthly experience gain. - **xpGain** (number) - Experience gained in that month. - **timestamp** (number) - Timestamp of the data. - **rank** (number) - Rank related to the experience gain for that month. #### Response Example ```json { "skill": { "id": 19, "name": "slayer" }, "totalExperience": 30150355, "totalGain": 13802938, "monthData": [ { "xpGain": 290353, "timestamp": 1553986429592, "rank": 59668 }, { "xpGain": 341001, "timestamp": 1556575611538, "rank": 54255 } ] } ``` ``` -------------------------------- ### Get Weaknesses Source: https://github.com/elian-argentics/runescape-api/blob/master/docs/bestiary.md Retrieves a list of all known weaknesses in Runescape. This information can be used to identify effective combat styles against different monsters. ```APIDOC ## GET /weaknesses ### Description Lists all weaknesses. ### Method GET ### Endpoint `/weaknesses` ### Parameters None ### Response #### Success Response (200) - **Array** - An array of `Weakness` objects, each containing `id` and `name`. ### Response Example ```json [ { "id": 1, "name": "Air" }, { "id": 8, "name": "Arrow" }, { "id": 9, "name": "Bolt" }, { "id": 7, "name": "Crushing" }, { "id": 3, "name": "Earth" }, { "id": 4, "name": "Fire" }, { "id": 0, "name": "None" }, { "id": 6, "name": "Slashing" }, { "id": 5, "name": "Stabbing" }, { "id": 10, "name": "Thrown" }, { "id": 2, "name": "Water" } ] ``` ``` -------------------------------- ### Get Beasts by Weakness (JavaScript) Source: https://github.com/elian-argentics/runescape-api/blob/master/docs/bestiary.md Lists all beasts that have a particular weakness. The function accepts a numerical 'weaknessId' as a parameter. It returns a promise which, upon resolution, provides an array of BeastSearchResult objects. ```javascript bestiary.getBeastsByWeakness(7).then(data => { console.log(data) }) ``` -------------------------------- ### RuneScape API: Browse Grand Exchange Categories and Search Items Source: https://context7.com/elian-argentics/runescape-api/llms.txt This snippet demonstrates how to fetch Grand Exchange categories, get item counts for specific categories, and search for items within a category by a given prefix. It utilizes the 'runescape-api' library and handles potential errors. ```javascript const rs = require('runescape-api'); // Get all Grand Exchange categories rs.grandexchange.getCategories() .then(categories => { categories.forEach(cat => { console.log(`Category ${cat.id}: ${cat.name}`); }); }) .catch(error => { console.error('Error:', error.message); }); // Get item counts for a category rs.grandexchange.getCategoryCounts(1) // Category 1: Miscellaneous .then(counts => { counts.forEach(entry => { console.log(`Letter ${entry.letter}: ${entry.items} items`); }); }) .catch(error => { console.error('Error:', error.message); }); // Search items by category and prefix rs.grandexchange.getCategoryCountsByPrefix(0, 'a', 1) // Category 0, prefix 'a', page 1 .then(items => { items.forEach(item => { console.log(`${item.name} (${item.id}) - ${item.current.price}`); }); }) .catch(error => { console.error('Error:', error.message); }); ``` -------------------------------- ### Get Slayer Categories (JavaScript) Source: https://github.com/elian-argentics/runescape-api/blob/master/docs/bestiary.md Retrieves a comprehensive list of all available slayer categories in the game. This function takes no arguments and returns a promise that resolves to an array of SlayerCategory objects. ```javascript bestiary.getSlayerCategories().then(data => { console.log(data) }) ``` -------------------------------- ### Get Player Data Source: https://github.com/elian-argentics/runescape-api/blob/master/docs/osrs/hiscores.md Retrieves detailed player statistics for a given player name and optional gamemode. ```APIDOC ## GET /getPlayer ### Description Retrieves a player's profile information, including their skills and activity logs. ### Method GET ### Endpoint `/getPlayer` ### Parameters #### Query Parameters - **playerName** (string) - Required - The name of the player to retrieve data for. - **gamemode** (string) - Optional - The gamemode of the player. Accepted values are: "normal", "ironman", "hardcore", "ultimate", "deadman", "seasonal". Defaults to "normal". ### Request Example ```json { "playerName": "Paqt", "gamemode": "normal" } ``` ### Response #### Success Response (200) - **name** (string) - The player's name. - **activities** (object) - An object containing activity scores and ranks. - **bosses** (object) - An object containing boss kill counts and ranks. - **skills** (object) - An object containing skill levels, experience, and ranks. #### Response Example ```json { "name": "Paqt", "activities": { "league_points": { "rank": -1, "count": -1 }, "bounty_hunter_hunter": { "rank": -1, "count": -1 }, "clue_scrolls_all": { "rank": 288824, "count": 53 } }, "bosses": { "abyssal_sire": { "rank": -1, "count": -1 }, "vorkath": { "rank": 46942, "count": 408 } }, "skills": { "overall": { "rank": 207774, "level": 1811, "experience": 65850144 }, "attack": { "rank": 254027, "level": 90, "experience": 5549049 }, "strength": { "rank": 324177, "level": 94, "experience": 8296000 } } } ``` ``` -------------------------------- ### Get Beasts by Weakness Source: https://github.com/elian-argentics/runescape-api/blob/master/docs/bestiary.md Retrieves a list of all beasts that have a specific weakness, identified by its weakness ID. This endpoint is useful for optimizing combat strategies. ```APIDOC ## GET /beasts/by-weakness/:weaknessId ### Description Lists all beasts with a given weakness. ### Method GET ### Endpoint `/beasts/by-weakness/{weaknessId}` ### Parameters #### Path Parameters - **weaknessId** (number) - Required - The ID of the weakness to filter by. ### Response #### Success Response (200) - **Array** - An array of `BeastSearchResult` objects, each containing `id` and `name`. ### Response Example ```json [ { "id": 2263, "name": "Abyssal leech (72)" }, { "id": 4283, "name": "Animated Adamant Armour (67)" }, { "id": 4281, "name": "Animated Black Armour (46)" }, { "id": 4278, "name": "Animated Bronze Armour (11)" }, { "id": 4279, "name": "Animated Iron Armour (25)" }, { "id": 4282, "name": "Animated Mithril Armour (53)" }, { "id": 4284, "name": "Animated Rune Armour (81)" }, { "id": 4280, "name": "Animated Steel Armour (39)" } ] ``` ``` -------------------------------- ### RuneScape API: Get Monster Information from Bestiary by ID or Search Source: https://context7.com/elian-argentics/runescape-api/llms.txt This snippet illustrates how to fetch detailed information about RuneScape monsters using their ID, including stats, weaknesses, and combat properties. It also shows how to search for monsters by a text term. Error handling is provided. ```javascript const rs = require('runescape-api'); // Get beast by ID rs.bestiary.getBeast(50) // General Graardor .then(beast => { console.log(`Name: ${beast.name}`); console.log(`Description: ${beast.examine}`); console.log(`Level: ${beast.level}`); console.log(`Lifepoints: ${beast.lifepoints}`); console.log(`Attack: ${beast.attack}`); console.log(`Defence: ${beast.defence}`); console.log(`Magic: ${beast.magic}`); console.log(`Ranged: ${beast.ranged}`); console.log(`Weakness: ${beast.weakness?.name}`); console.log(`Attackable: ${beast.attackable}`); console.log(`Aggressive: ${beast.aggressive}`); console.log(`Members: ${beast.members}`); }) .catch(error => { console.error('Error fetching beast:', error.message); }); // Search beasts by term rs.bestiary.getBeastsByTerms('dragon') .then(beasts => { beasts.forEach(beast => { console.log(`${beast.name} (ID: ${beast.id})`); }); }) .catch(error => { console.error('Error:', error.message); }); ``` -------------------------------- ### Get Quests by Player Name Source: https://github.com/elian-argentics/runescape-api/blob/master/docs/runemetrics.md Retrieves a user's quest list with completion status for a given player name. ```APIDOC ## GET /getQuests ### Description Retrieve a user's quest list with completion status. ### Method GET ### Endpoint /getQuests/:playerName ### Parameters #### Path Parameters - **playerName** (string) - Required - The name of the player whose quests are to be retrieved. ### Request Example ```javascript runemetrics.getQuests("Paqt").then(data => { console.log(data) }) ``` ### Response #### Success Response (200) - **name** (string) - The name of the quest. - **status** (string) - The completion status of the quest (e.g., 'COMPLETED'). - **difficulty** (number) - The difficulty level of the quest. - **members** (boolean) - Indicates if the quest is for members. - **questPoints** (number) - The quest points awarded for completing the quest. - **eligible** (boolean) - Indicates if the player is eligible for the quest. #### Response Example ```json [ { "name": "A Fairy Tale I - Growing Pains", "status": "COMPLETED", "difficulty": 2, "members": true, "questPoints": 2, "eligible": true }, { "name": "A Fairy Tale II - Cure a Queen", "status": "COMPLETED", "difficulty": 2, "members": true, "questPoints": 2, "eligible": true } // ... more quest items ] ``` ``` -------------------------------- ### Get Slayer Categories Source: https://github.com/elian-argentics/runescape-api/blob/master/docs/bestiary.md Retrieves a comprehensive list of all available slayer categories in Runescape. This endpoint provides a reference for slayer tasks and assignments. ```APIDOC ## GET /slayer-categories ### Description Lists all slayer categories. ### Method GET ### Endpoint `/slayer-categories` ### Parameters None ### Response #### Success Response (200) - **Array** - An array of `SlayerCategory` objects, each containing `id` and `name`. ### Response Example ```json [ { "id": 41, "name": "Aberrant spectres" }, { "id": 42, "name": "Abyssal demons" }, { "id": 133, "name": "Acheron mammoths" }, { "id": 127, "name": "Adamant dragons" }, { "id": 117, "name": "Airut" }, { "id": 79, "name": "Ankou" } ] ``` ``` -------------------------------- ### Get RuneScape Clan Member List using runescape-api Source: https://context7.com/elian-argentics/runescape-api/llms.txt Retrieves a list of members for a specified RuneScape clan, including their rank, experience, and kill count. It also demonstrates filtering members by rank. ```javascript const rs = require('runescape-api'); // Get clan members rs.clan.getMembers('Divine Forces') .then(members => { members.forEach(member => { console.log(`Player: ${member.name}`); console.log(` Rank: ${member.rank}`); console.log(` Experience: ${member.experience.toLocaleString()}`); console.log(` Kills: ${member.kills}`); }); console.log(`Total Members: ${members.length}`); }) .catch(error => { console.error('Error fetching clan members:', error.message); }); // Filter clan members by rank rs.clan.getMembers('My Clan Name') .then(members => { const owners = members.filter(m => m.rank === 'Owner'); const deputies = members.filter(m => m.rank === 'Deputy Owner'); const coordinators = members.filter(m => m.rank === 'Coordinator'); console.log(`Owners: ${owners.length}`); console.log(`Deputies: ${deputies.length}`); console.log(`Coordinators: ${coordinators.length}`); }) .catch(error => { console.error('Error:', error.message); }); ``` -------------------------------- ### Get RuneScape Grand Exchange Item Details (JavaScript) Source: https://context7.com/elian-argentics/runescape-api/llms.txt Retrieves detailed information about Grand Exchange items, including current prices, price trends, and historical data using item IDs. ```javascript const rs = require('runescape-api'); // Get item details by ID rs.grandexchange.getItem(4151) // Abyssal whip .then(item => { console.log(`Item: ${item.name}`); console.log(`Description: ${item.examine}`); console.log(`Members: ${item.members}`); console.log(`Category: ${item.category.name}`); console.log(`Current Price: ${item.trends.current.price}`); console.log(`Current Trend: ${item.trends.current.trend}`); console.log(`Today's Change: ${item.trends.today.price}`); console.log(`30-day Trend: ${item.trends.day30?.trend}`); console.log(`Icon URL: ${item.icons.large}`); }) .catch(error => { console.error('Error fetching item:', error.message); }); // Get price graph data rs.grandexchange.getItemGraph(4151) .then(graph => { console.log(`Item ID: ${graph.id}`); console.log('Daily prices:', graph.daily); console.log('Average prices:', graph.average); // graph.daily is { "1609459200000": 2500000, ... } - timestamp: price }) .catch(error => { console.error('Error:', error.message); }); ``` -------------------------------- ### RuneMetrics - Get Quest List and Monthly XP Gains (JavaScript) Source: https://context7.com/elian-argentics/runescape-api/llms.txt Fetches a player's quest completion status and monthly experience gains for skills from RuneMetrics. Supports fetching quests by username and monthly XP by username and skill ID or Skill object. Requires the 'runescape-api' library. ```javascript const rs = require('runescape-api'); // Get player quests rs.runemetrics.getQuests('Zezima') .then(quests => { quests.forEach(quest => { console.log(`Quest: ${quest.name}`); console.log(` Status: ${quest.status}`); console.log(` Difficulty: ${quest.difficulty}`); console.log(` Members: ${quest.members}`); console.log(` Quest Points: ${quest.questPoints}`); console.log(` Eligible: ${quest.eligible}`); }); }) .catch(error => { console.error('Error fetching quests:', error.message); }); // Get monthly XP for a skill rs.runemetrics.getMonthlyXp('Zezima', 0) // 0 = Overall .then(xpData => { console.log(`Skill: ${xpData.skill.name}`); console.log(`Total Experience: ${xpData.totalExperience}`); console.log(`Total Gain: ${xpData.totalGain}`); console.log('Monthly Data:', xpData.monthData); }) .catch(error => { console.error('Error fetching monthly XP:', error.message); }); // Get monthly XP using Skill object const { Skill } = require('runescape-api').lib.RuneScape; const attackSkill = new Skill('attack'); rs.runemetrics.getMonthlyXp('PlayerName', attackSkill) .then(xpData => { console.log(`Monthly XP for ${xpData.skill.name}`); console.log(`Gain: ${xpData.totalGain}`); }) .catch(error => { console.error('Error:', error.message); }); ``` -------------------------------- ### Get Player Profile Source: https://github.com/elian-argentics/runescape-api/blob/master/docs/runemetrics.md Retrieves a user's RuneMetrics profile, including their combat level, experience distribution, overall stats, skills, quest progress, and recent activities. ```APIDOC ## GET /runemetrics/profile ### Description Retrieve a user's RuneMetrics profile name and associated data. ### Method GET ### Endpoint `/runemetrics/profile` ### Parameters #### Query Parameters - **playerName** (string) - Required - The in-game name of the player whose profile is to be retrieved. ### Request Example ``` GET /runemetrics/profile?playerName=Paqt ``` ### Response #### Success Response (200) - **name** (string) - The player's in-game name. - **combatLevel** (number) - The player's current combat level. - **experience_distribution** (object) - An object containing experience distribution across combat types (magic, melee, ranged). - **magic** (number) - **melee** (number) - **ranged** (number) - **overall** (object) - An object containing overall player statistics. - **rank** (number) - The player's overall rank. - **level** (number) - The player's overall level. - **experience** (number) - The player's total experience. - **skills** (object) - An object containing detailed statistics for each skill. - **overall** (object) - Overall skill statistics. - **rank** (number) - **level** (number) - **experience** (number) - **attack** (object) - Attack skill statistics. - **rank** (number) - **level** (number) - **experience** (number) - ... (other skills like Defence, Strength, Constitution, Ranged, Prayer, Magic, Cooking, Woodcutting, Fletching, Fishing, Firemaking, Crafting, Smithing, Mining, Herblore, Agility, Thieving, Slayer, Farming, Runecrafting, Hunter, Construction, Summoning, Dungeoneering, Divination, Invention) - **quests** (object) - An object containing quest progress. - **complete** (number) - The number of quests completed. - **started** (number) - The number of quests started. - **not_started** (number) - The number of quests not started. - **activities** (array) - A list of recent player activities. - **title** (string) - The title of the activity. - **description** (string) - A description of the activity. - **date** (string) - The date and time the activity occurred. #### Response Example ```json { "name": "Paqt", "combatLevel": 116, "experience_distribution": { "magic": 1388722, "melee": 38605287, "ranged": 4177540 }, "overall": { "rank": 333433, "level": 1929, "experience": 73706113 }, "skills": { "overall": { "rank": 355648, "level": 85, "experience": 33169037 }, "attack": { "rank": 345457, "level": 85, "experience": 35044619 }, "defence": { "rank": 364015, "level": 87, "experience": 39885284 }, "strength": { "rank": 392848, "level": 87, "experience": 41775402 }, "constitution": { "rank": 403383, "level": 79, "experience": 19172809 }, "ranged": { "rank": 333802, "level": 76, "experience": 13887225 }, "prayer": { "rank": 361412, "level": 86, "experience": 39335527 }, "magic": { "rank": 427228, "level": 73, "experience": 10224021 }, "cooking": { "rank": 87705, "level": 99, "experience": 150601597 }, "woodcutting": { "rank": 131492, "level": 99, "experience": 132964135 }, "fletching": { "rank": 276258, "level": 83, "experience": 27258878 }, "fishing": { "rank": 174737, "level": 99, "experience": 131605606 }, "firemaking": { "rank": 406598, "level": 69, "experience": 7162753 }, "crafting": { "rank": 484064, "level": 65, "experience": 4746375 }, "smithing": { "rank": 481099, "level": 68, "experience": 6155160 }, "mining": { "rank": 397512, "level": 61, "experience": 3272737 }, "herblore": { "rank": 432198, "level": 60, "experience": 2754656 }, "agility": { "rank": 381537, "level": 61, "experience": 3138007 }, "thieving": { "rank": 388917, "level": 69, "experience": 7178440 }, "slayer": { "rank": 350054, "level": 60, "experience": 2831891 }, "farming": { "rank": 394855, "level": 60, "experience": 2881919 }, "runecrafting": { "rank": 379164, "level": 62, "experience": 3448319 }, "hunter": { "rank": 406448, "level": 60, "experience": 2744480 }, "construction": { "rank": 383513, "level": 62, "experience": 3569058 }, "summoning": { "rank": 401807, "level": 61, "experience": 3219611 }, "dungeoneering": { "rank": 286981, "level": 72, "experience": 9033714 }, "divination": { "rank": 0, "level": 1, "experience": 0 }, "invention": { "rank": 0, "level": 1, "experience": 0 } }, "quests": { "complete": 132, "started": 18, "not_started": 144 }, "activities": [ { "title": "Visited my Clan Citadel.", "description": "I have visited my Clan Citadel this week.", "date": "04-Feb-2020 01:13" }, { "title": "Visited my Clan Citadel.", "description": "I have visited my Clan Citadel this week.", "date": "24-Jan-2020 21:12" } ] } ``` ``` -------------------------------- ### OSRS Hiscores - Get Old School Player Data Source: https://context7.com/elian-argentics/runescape-api/llms.txt Fetch player statistics for Old School RuneScape including skills, activities, and boss kill counts with support for multiple game modes. ```APIDOC ## OSRS Hiscores - Get Old School Player Data ### Description Fetch player statistics for Old School RuneScape including skills, activities, and boss kill counts with support for multiple game modes. ### Method `GET` (Implicitly via library function) ### Endpoint `N/A` (Handled by the library) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```javascript const rs = require('runescape-api'); // Get OSRS player stats rs.osrs.hiscores.getPlayer('Lynx Titan') .then(player => { console.log(`Player: ${player.name}`); console.log(`Overall Level: ${player.skills.overall.level}`); console.log(`Mining XP: ${player.skills.mining.experience}`); console.log(`Zulrah KC: ${player.bosses.zulrah.count}`); console.log(`LMS - Rank: ${player.activities['LMS - Rank'].rank}`); }) .catch(error => { console.error('Error fetching OSRS player:', error.message); }); // Get OSRS Ultimate Ironman stats rs.osrs.hiscores.getPlayer('Settled', 'ultimate') .then(player => { console.log(`${player.name} - Ultimate Ironman`); console.log(`Wintertodt KC: ${player.bosses.wintertodt.count}`); }) .catch(error => { console.error('Error:', error.message); }); ``` ### Response #### Success Response (200) - **name** (string) - The player's username. - **skills** (object) - An object containing skill data, with properties for each skill (e.g., 'overall', 'mining'). Each skill object has 'level' and 'experience' properties. - **bosses** (object) - An object containing boss kill counts, with properties for each boss (e.g., 'zulrah', 'wintertodt'). Each boss object has a 'count' property. - **activities** (object) - An object containing activity data, with keys for specific activities (e.g., 'LMS - Rank'). Each activity object has a 'rank' property. #### Response Example ```json { "name": "Lynx Titan", "skills": { "overall": { "level": 2277, "experience": 437866100 }, "mining": { "level": 99, "experience": 41170000 } }, "bosses": { "zulrah": { "rank": 1, "count": 5000 } }, "activities": { "LMS - Rank": { "rank": 50, "score": 12345 } } } ``` ``` -------------------------------- ### Get Total Registered Users - JavaScript Source: https://github.com/elian-argentics/runescape-api/blob/master/docs/miscellaneous.md Fetches the total count of registered RuneScape accounts. This function does not require any input parameters and outputs a numerical value representing the total user count. ```javascript import { miscellaneous } from "runescape-api" miscellaneous.getTotalUsers().then(data => { console.log(data) }) ``` -------------------------------- ### Get Monthly XP Gain Source: https://github.com/elian-argentics/runescape-api/blob/master/docs/runemetrics.md Retrieves a user's monthly experience gained in a specific Runescape skill. Requires the player's name and the skill ID. The function returns a promise that resolves with the experience data. ```javascript runemetrics.getMonthlyXp("Conundrum129", 19).then(data => { console.log(data) }) ``` -------------------------------- ### Get All Bestiary Areas Source: https://github.com/elian-argentics/runescape-api/blob/master/docs/bestiary.md Retrieves a list of all available bestiary areas. This function does not require any parameters and returns an array of Area objects. Useful for understanding the scope of the bestiary data. ```javascript bestiary.getAreas().then(data => { console.log(data) }) ``` -------------------------------- ### Get Beasts by Slayer Category (JavaScript) Source: https://github.com/elian-argentics/runescape-api/blob/master/docs/bestiary.md Fetches a list of beasts belonging to a specific slayer category. This function requires a numerical 'categoryId' as input. The result is a promise that resolves to an array of BeastSearchResult objects. ```javascript bestiary.getBeastsBySlayerCategory(45).then(data => { console.log(data) }) ``` -------------------------------- ### RuneMetrics - Get Player Profile and Activity Feed (JavaScript) Source: https://context7.com/elian-argentics/runescape-api/llms.txt Retrieves a player's detailed profile and recent activity from Runescape's RuneMetrics service. The profile includes combat level, skill breakdown, quest progress, and experience distribution. Requires the 'runescape-api' library and a player's username. ```javascript const rs = require('runescape-api'); // Get player profile rs.runemetrics.getProfile('Zezima') .then(profile => { console.log(`Player: ${profile.name}`); console.log(`Combat Level: ${profile.combatLevel}`); console.log(`Overall Rank: ${profile.overall.rank}`); console.log(`Total Level: ${profile.overall.level}`); console.log(`Total XP: ${profile.overall.experience}`); console.log(`Magic XP: ${profile.experience_distribution.magic}`); console.log(`Melee XP: ${profile.experience_distribution.melee}`); console.log(`Ranged XP: ${profile.experience_distribution.ranged}`); // Skills console.log(`Attack Level: ${profile.skills.attack.level}`); console.log(`Attack XP: ${profile.skills.attack.experience}`); // Quests console.log(`Quests Complete: ${profile.quests.complete}`); console.log(`Quests Started: ${profile.quests.started}`); console.log(`Quests Not Started: ${profile.quests.not_started}`); // Recent activities profile.activities.forEach(activity => { console.log(`${activity.title}: ${activity.description} (${activity.date})`); }); }) .catch(error => { console.error('Error fetching profile:', error.message); }); ``` -------------------------------- ### Get Player Avatar URL - JavaScript Source: https://github.com/elian-argentics/runescape-api/blob/master/docs/miscellaneous.md Retrieves the URL for a player's RuneScape avatar. Requires the player's username as input. Outputs the avatar image URL. ```javascript import { miscellaneous } from "runescape-api" miscellaneous.getAvatar("Conundrum129").then(data => { console.log(data) }) ``` -------------------------------- ### Get Old School RuneScape Player Hiscores (JavaScript) Source: https://context7.com/elian-argentics/runescape-api/llms.txt Fetches player statistics for Old School RuneScape, including skills, activities, and boss kill counts. Supports various game modes. ```javascript const rs = require('runescape-api'); // Get OSRS player stats rs.osrs.hiscores.getPlayer('Lynx Titan') .then(player => { console.log(`Player: ${player.name}`); console.log(`Overall Level: ${player.skills.overall.level}`); console.log(`Mining XP: ${player.skills.mining.experience}`); console.log(`Zulrah KC: ${player.bosses.zulrah.count}`); console.log(`LMS - Rank: ${player.activities['LMS - Rank'].rank}`); }) .catch(error => { console.error('Error fetching OSRS player:', error.message); }); // Get OSRS Ultimate Ironman stats rs.osrs.hiscores.getPlayer('Settled', 'ultimate') .then(player => { console.log(`${player.name} - Ultimate Ironman`); console.log(`Wintertodt KC: ${player.bosses.wintertodt.count}`); }) .catch(error => { console.error('Error:', error.message); }); ``` -------------------------------- ### Get Item Details by ID - JavaScript Source: https://github.com/elian-argentics/runescape-api/blob/master/docs/osrs/grandexchange.md Retrieves detailed information about a specific Grand Exchange item using its ID. Requires the 'grandexchange' module to be imported. Returns an 'Item' object with properties like name, examine text, category, and pricing trends. ```javascript grandexchange.getItem(4151).then(data => { console.log(data) }) ``` -------------------------------- ### Get RuneScape Player Hiscores (JavaScript) Source: https://context7.com/elian-argentics/runescape-api/llms.txt Retrieves player statistics for RuneScape 3, including skill levels, experience points, and activity rankings. Supports different game modes like normal and ironman. ```javascript const rs = require('runescape-api'); // Get player stats for normal mode rs.hiscores.getPlayer('Zezima') .then(player => { console.log(`Player: ${player.name}`); console.log(`Overall Level: ${player.skills.overall.level}`); console.log(`Overall XP: ${player.skills.overall.experience}`); console.log(`Attack Level: ${player.skills.attack.level}`); console.log(`Clue Scrolls (Elite): ${player.activities['Clue Scrolls (Elite)'].count}`); }) .catch(error => { console.error('Error fetching player:', error.message); }); // Get ironman player stats rs.hiscores.getPlayer('Iron Mammal', 'ironman') .then(player => { console.log(`${player.name} - Ironman Stats`); console.log(`Overall Rank: ${player.skills.overall.rank}`); console.log(`Total Level: ${player.skills.overall.level}`); }) .catch(error => { console.error('Error:', error.message); }); ``` -------------------------------- ### Hiscores - Get Player Statistics (RuneScape 3) Source: https://context7.com/elian-argentics/runescape-api/llms.txt Retrieve player statistics including skill levels, experience points, and activity rankings for RuneScape 3 across different game modes (normal, ironman, hardcore, ultimate). ```APIDOC ## Get Player Statistics (RuneScape 3) ### Description Retrieve player statistics including skill levels, experience points, and activity rankings for RuneScape 3 across different game modes (normal, ironman, hardcore, ultimate). ### Method `GET` (Implicitly via library function) ### Endpoint `N/A` (Handled by the library) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```javascript const rs = require('runescape-api'); // Get player stats for normal mode rs.hiscores.getPlayer('Zezima') .then(player => { console.log(`Player: ${player.name}`); console.log(`Overall Level: ${player.skills.overall.level}`); console.log(`Overall XP: ${player.skills.overall.experience}`); console.log(`Attack Level: ${player.skills.attack.level}`); console.log(`Clue Scrolls (Elite): ${player.activities['Clue Scrolls (Elite)'].count}`); }) .catch(error => { console.error('Error fetching player:', error.message); }); // Get ironman player stats rs.hiscores.getPlayer('Iron Mammal', 'ironman') .then(player => { console.log(`${player.name} - Ironman Stats`); console.log(`Overall Rank: ${player.skills.overall.rank}`); console.log(`Total Level: ${player.skills.overall.level}`); }) .catch(error => { console.error('Error:', error.message); }); ``` ### Response #### Success Response (200) - **name** (string) - The player's username. - **skills** (object) - An object containing skill data, with properties for each skill (e.g., 'overall', 'attack'). Each skill object has 'level' and 'experience' properties. - **activities** (object) - An object containing activity data, with keys for specific activities (e.g., 'Clue Scrolls (Elite)'). Each activity object has a 'count' property. #### Response Example ```json { "name": "Zezima", "skills": { "overall": { "level": 2277, "experience": 1049861000 }, "attack": { "level": 99, "experience": 13034431 } }, "activities": { "Clue Scrolls (Elite)": { "rank": 1, "count": 1500 } } } ``` ``` -------------------------------- ### Get RuneMetrics Profile by Player Name (JavaScript) Source: https://github.com/elian-argentics/runescape-api/blob/master/docs/runemetrics.md Retrieves a RuneMetrics profile for a specified player. This function requires the player's name as a string argument and returns a promise that resolves with the profile data. The response includes details like combat level, experience distribution, overall stats, skills, quests, and recent activities. ```javascript runemetrics.getProfile("Paqt").then(data => { console.log(data) }) ``` -------------------------------- ### Get Grand Exchange Category Counts by Prefix (JavaScript) Source: https://github.com/elian-argentics/runescape-api/blob/master/docs/grandexchange.md Retrieves item counts within a specified Grand Exchange category, filtered by an initial letter (prefix). An optional page number can be provided for pagination. This is useful for detailed exploration of category contents. ```javascript grandexchange.getCategoryCountsByPrefix(24, "b").then(data => { console.log(data) }) ``` -------------------------------- ### Get Runescape Player Data in JavaScript Source: https://github.com/elian-argentics/runescape-api/blob/master/docs/osrs/hiscores.md This JavaScript snippet demonstrates how to use the `getPlayer` function from the `hiscores` library to fetch a player's data. It takes the player's name as a required argument and an optional gamemode. The function returns a Promise that resolves with the player's data, which is then logged to the console. ```javascript hiscores.getPlayer("Paqt").then(data => { console.log(data) }) ```