Quick OPGG Scraper (quick-opgg-scraper
) is a OP.GG (League of Legends) stat scraper that doesn't rely on (headless-) browsers and instead uses Axios + Cheerio
- Fast and Lightweight: No need for heavy headless browsers.
- Easy to Use: Simple functions for fetching player stats.
- Flexible: Supports multiple regions.
- Caching: Supports caching using
node-cache
Install Quick OP.GG Scraper (quick-opgg-scraper
) using npm:
npm install quick-opgg-scraper
Or using yarn:
yarn add quick-opgg-scraper
Here's a quick example to get you started:
const { getPlayerData, Region } = require("quick-opgg-scraper");
// Fetches the player data for 'TheShackledOne#004' on EUW
getPlayerData("TheShackledOne#004", Region.EUROPE_WEST)
.then((data) => {
console.log(data);
})
.catch((error) => {
console.error(error);
});
Which returns:
{
riotId: 'TheShackledOne#004',
name: 'TheShackledOne',
tag: '004',
region: 'euw',
level: '117',
ranked: {
soloQueue: {
rank: 'challenger',
lp: '1,618 LP',
wins: '133',
losses: '80',
winrate: '62%',
ladderRank: '10'
},
flexQueue: { rank: null, lp: null, wins: null, losses: null, winrate: null }
},
icon: {
url: 'https://opgg-static.akamaized.net/meta/images/profile_icons/profileIcon1374.jpg',
id: '1374'
},
mostPlayedChampions: [
'Ashe', 'Jinx',
'Lucian', 'Kalista',
'Caitlyn', 'Varus',
'Draven'
]
}
Another example:
const opggScraper = require('quick-opgg-scraper');
opggScraper.getPlayerData('RAT KING#xpp', opggScraper.Region.EUROPE_WEST).then((data) => {
console.log(data);
});
const { configureCacheSettings } = require("quick-opgg-scraper");
configureCacheSettings({
enabled: true,
ttl: 300, // adjust cache TTL to 5 minutes
});
The following regions are supported:
- North America (
Region.NORTH_AMERICA
) - Europe West (
Region.EUROPE_WEST
) - Europe Nordic & East (
Region.EUROPE_NORDICEAST
) - Korea (
Region.KOREA
) - Middle East (
Region.MIDDLE_EAST
) - Oceania (
Region.OCEANIA
) - Japan (
Region.JAPAN
) - Brazil (
Region.BRAZIL
) - Latin America South (
Region.LATIN_AMERICA_SOUTH
) - Latin America North (
Region.LATIN_AMERICA_NORTH
) - Russia (
Region.RUSSIA
) - Türkiye (
Region.TURKIYE
) - Singapore (
Region.SINGAPORE
) - Philippines (
Region.PHILIPPINES
) - Taiwan (
Region.TAIWAN
) - Vietnam (
Region.VIETNAM
) - Thailand (
Region.THAILAND
)
- Top 100 Leaderboard Scraper
- Seperate functions to get specific data (e.g.
getPlayerName
,getPlayerIconId
) - Player Recently Played With Scraper
- Player Top Mastery Scraper
Contributions are welcome! Please feel free to submit a pull request or open an issue.
This project is licensed under the MIT License - see the LICENSE file for details.
If you like this project, consider supporting me
For any questions or support, contact me here.
⭐ Star us on GitHub — it helps!
🤍 Consider checking out my website