Git Product home page Git Product logo

Comments (3)

bricefrisco avatar bricefrisco commented on July 20, 2024

I could expose a public API, but it would only be for the name list.

There is already an official Riot API for summoner names, the docs are here:
https://developer.riotgames.com/apis#summoner-v4/GET_getBySummonerName

This endpoint returns a revisionDate, which I then feed into this function, calcAvailabilityDate:
https://github.com/bricefrisco/NamesLoL/blob/master/src/libs/mapper.ts#L6

An API for an individual summoner name could be simplified to the following, hopefully this helps:

const fetchExpirationDate = async (name, token) => {
  const res = await fetch(`https://na1.api.riotgames.com/lol/summoner/v4/summoners/by-name/${name}`, {
      headers: {
        'X-Riot-Token': token
      }
  });

  const { revisionDate, summonerLevel } = await res.json();
  const nameDecayInMonths = Math.min(30, Math.max(6, summonerLevel));

  const expirationDate = new Date(revisionDate);
  expirationDate.setMonth(expirationDate.getMonth() + nameDecayInMonths);
  return expirationDate;
}

from nameslol.

Infinitay avatar Infinitay commented on July 20, 2024

Oh I wasn't aware their API was available so readily, I should have done a Google Search before requesting you to make your API public. I'll go ahead and do this. Thank you.

EDIT: Oh, completely missed the development key is temporary for 24 hours and you still need to apply which I wasn't trying to deal with. Although I suppose I have no option but to wait to apply after Jan 3rd (they suspended apps).

Also, personally I was more interested in using your endpoint for specific names, but having your name list would not be a bad idea.

Side note, what are your thoughts on making a statics page using your data? For example, estimated owned accounts, estimated active accounts, etc. I know it's limited, but seeing as you have the data, would be interesting.

from nameslol.

bricefrisco avatar bricefrisco commented on July 20, 2024

Oh I wasn't aware their API was available so readily, I should have done a Google Search before requesting you to make your API public. I'll go ahead and do this. Thank you.

EDIT: Oh, completely missed the development key is temporary for 24 hours and you still need to apply which I wasn't trying to deal with. Although I suppose I have no option but to wait to apply after Jan 3rd (they suspended apps).

Also, personally I was more interested in using your endpoint for specific names, but having your name list would not be a bad idea.

Side note, what are your thoughts on making a statics page using your data? For example, estimated owned accounts, estimated active accounts, etc. I know it's limited, but seeing as you have the data, would be interesting.

A bit of a late response here, but I will be working on making a public API in the next month or so. The public API will have rate limits similar to that of Riots, so it will be pointless to use it for the sole purpose of bypassing Riot's rate limits. But, it may be useful in other legitimate use-cases.

from nameslol.

Related Issues (8)

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.