Giter VIP home page Giter VIP logo

quick-opgg-scraper's Introduction

⚡ Quick OP.GG Scraper

A fast OPGG Scraper for League of Legends stats.

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


Features

  • 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

Installation

Install Quick OP.GG Scraper (quick-opgg-scraper) using npm:

npm install quick-opgg-scraper

Or using yarn:

yarn add quick-opgg-scraper

Usage

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);
});

You can also adjust the cache settings:

const { configureCacheSettings } = require("quick-opgg-scraper");

configureCacheSettings({
  enabled: true,
  ttl: 300, // adjust cache TTL to 5 minutes
});

Supported Regions

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)

Planned Features

  • Top 100 Leaderboard Scraper
  • Seperate functions to get specific data (e.g. getPlayerName, getPlayerIconId)
  • Player Recently Played With Scraper
  • Player Top Mastery Scraper

Contributing

Contributions are welcome! Please feel free to submit a pull request or open an issue.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

If you like this project, consider supporting me

For any questions or support, contact me here.


⭐ Star us on GitHub — it helps!

GitHub stars

🤍 Consider checking out my website

Rico van Zelst

quick-opgg-scraper's People

Contributors

rico-vz avatar

Stargazers

 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.