Comments (3)
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.
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.
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)
- Possibility for a 2 letter name filter? HOT 1
- OCE not searching HOT 1
- Name expiry time HOT 1
- Certain names are removed from the expiration list moments before while most stay on the list after expiration HOT 2
- Refactor code to use async/await instead of promise chains HOT 1
- Please include de BR region HOT 1
- Please add Japan region HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nameslol.