Jump to content

Let's Talk About the API Keys


Yosodog
 Share

Recommended Posts

For those confused: 

 

 

I've set up API restrictions on the test server; namely that you need an API key to make API requests. An API key costs 1 Credit, and you can upgrade it/purchase additional keys for more Credits.

 

You can read up a bit on it and test it here: http://test.politicsandwar.com/account/

 

Looking for general feedback. This won't be pushed out immediately or anything, but unless there's major concern I'm more or less happy with the API key system as-is, and will be working on adding more to the API in the future to make it more beneficial to purchase keys.

 

Also, increased the max war limit for the wars API to 5000 as well. 

Edited by Doom Marine
  • Upvote 1

q8nfyvc.gif

Link to comment
Share on other sites

  • Administrators

Thanks for your feedback. I had asked in Discord a couple of times to talk directly to people who use the API frequently, and didn't get any responses, so I threw together a quick system.

 

I like the idea of restricting API keys to VIP members. You're probably right, making it a subscription vs. a one-time fee would probably generate more money.

 

One of my main concerns and reasons for wanting to limit the API to daily requests is that people are using the API to check trade prices super frequently and jump on accidental trades, in many cases before the player who posted the trade has the chance to realize their mistake and cancel it. I've gotten many complaints about this, and how people are "botting" and it's unfair because they don't know how to set up scripts to get that advantage.

 

My current feelings on the matter are:

 

I'm sold on giving everyone with a VIP subscription an API key.

I'm fine with increasing the number of requests allowed.

 

I'm not sold on making it requests per minute. For your alliance example, I can just change it up so that all alliances are displayed in one page and you don't need to do individual requests for those out of the top 50, and similarly for other API pages in the same boat.

  • Upvote 1

Is there a bug? Report It | Not understanding game mechanics? Ask About It | Got a good idea? Suggest It

Forums Rules | Game Link

Link to comment
Share on other sites

  • Administrators

You shouldn't have to pay to use the API.

 

It's an easy way to fund the game without making it pay-to-win or burdening most users. Plus, I figure the small number of people who actually use the API get a ton of utility out of it, and would be willing to pay to use it. Seems like a logical thing to pay to use imo.

Is there a bug? Report It | Not understanding game mechanics? Ask About It | Got a good idea? Suggest It

Forums Rules | Game Link

Link to comment
Share on other sites

I bought $80m in credits today and I'll spend them all slowly levelling up my API key to an absurd level if that's what I have to do.

 

Here's an example of some really simple data gathering for fun that took 1500 API requests during one day. That's nothing compared to the amount of requests I use when it actually matters, like loading everyone's military counts during a war. 


Link to comment
Share on other sites

 

One of my main concerns and reasons for wanting to limit the API to daily requests is that people are using the API to check trade prices super frequently and jump on accidental trades, in many cases before the player who posted the trade has the chance to realize their mistake and cancel it. I've gotten many complaints about this, and how people are "botting" and it's unfair because they don't know how to set up scripts to get that advantage.

 

 

I must confess that much of this is my fault, at least if the jump was recent. A previous version (in the form of a plugin) was distributed on the forum with a far superior version having recently been distributed it within BK via greasyfork. It has always been my intention to distribute it to anyone who is interested, but finals season has slowed that down somewhat......

 

If you decide to restrict it to VIP, that seems reasonable on the surface. It will, however, give VIP subscribers a significant advantage in the Resource Brokering field. That is my only concern with the idea.

 

Also, if I understand the game rules correctly, it is only actually "Botting" if the script itself is making the trade. In this case, all the information is publicly available and these players are just able to access it more quickly. 

 

Sometime within the next few days I will post the aide visibly on these forums. For now, here is where it can be found if anyone reading this is interested: https://greasyfork.org/en/scripts/24872-fliesnow-s-politics-and-war-aide

Check out my P&W Aide here: https://greasyfork.org/en/scripts/24872-fliesnow-s-politics-and-war-aide


 


Crux sacra sit mihi lux; Non draco sit mihi dux

Link to comment
Share on other sites

I hadn't heard of any of this before this topic and my only leg in this discussion, is that depending on how it all gets implemented, a side effect may be it killing off my Alliance Leaderboards (https://politicsandwar.com/forums/index.php?/topic/16632-the-alliance-leaderboards/). :(

 

If I end up having to get credits or pay for trying to gather the stats for that topic then i'll probably lose interest towards doing it further.

 

Currently my program for creating the daily stats calls the main Alliances API once, the main Nations API once, and the individual alliance api for each alliance in the game once to get the info not on the main alliances api (military stats, treasure stats, gdp, applicant and vmode numbers).

 

Seems silly that due to people gaining an advantage from the trading api, all others will suffer too even for completely unrelated use cases and for ones that don't really give any supposed "unfair advantage".

Edited by Shadow
  • Upvote 1
tvPWtuA.gif
Link to comment
Share on other sites

The only personal grievance I have with this is people using this to constantly refresh troop counts/etc so that they can instantly disarm a nuke seconds after it's made. Some have bots that take this information and automatically post it to chat groups they're a part of.

 

I am VERY unfamiliar with this kind of thing so I don't even know if we're discussing the same things, but I can find no other way to classify that kind of thing other than an unfair advantage. I'm also biased in regards to that since I'm a lone wolf.

  • Upvote 1
Link to comment
Share on other sites

If the fact that people are abusing the tradeprice API is an issue, then a simple solution would be to make that one not serve live information. Only update it once every so often.

 

That being said, I would gladly pay to use the API. But only if it's an actual, quality product, not the hodgepodge of a mess it is now.

 

Rate limiting by the minute is a much better idea than by the day. I take daily snapshots of every city and nation in-game, and I'm not the only one. That means that for my perfectly legitimate, once-per-day activities, I need to make upwards of 30k requests. A daily limit that would allow me to do that would allow someone who only uses the tradeprice API to nearly constantly make requests during the time that they're active. A minute-based rate limit would be much more effective at making sure that the server isn't flooded with requests in either case. Maybe use both? Or restructure the API so that it doesn't take 30k requests to get all of the information I need.

  • Upvote 1
RollSheepy.png

Link to comment
Share on other sites

Limiting by the minute certainly seems better, as is restricting to VIPs for the super serious stuff as it would be relatively cheap for a decent taxbase alliance to fund that for the data members.

 

A side thought for limits, could perhaps implement a sort of on-peak off-peak sort of thing ie have less requests available on the turn/day change. I'm not a big user of it but we've got a few programs, and incentivising people to request on the off peak could help

As you sow, so shall you reap

Link to comment
Share on other sites

I would gladly pay several credits per month for access. The data is somewhat limited on the broader pages like all nations which requires me to currently go individually through each nations api.

 

Restricting my number of hits below what I would need to do anything useful would dissuade me from purchasing access if that is the pay structure you put in place without making your broader api pages more useful.

 

If it's a binary on/off access in the current api structure I'm paying each and every month

Link to comment
Share on other sites

From the perspective of someone teaching himself how to code, I can just about make a few simple tools that utilise the API and even they require a couple of hundred requests to complete. The PnW API has been a great tool to practice coding as it's easily accessible and allows me to make scripts that are actually useful in some way.

 

I'll happily pay a couple of credits to use it, but if it becomes tricky to access or If access is put behind such a heavy paywall then I'd be put off having to pay a lot for something I might not get working.

  • Upvote 1
Link to comment
Share on other sites

  • Administrators

Sheepy, in case you were wondering, it's updates like this which is why credits purchases are down. They'll buy for awhile and go right back down. Don't listen to them above about paying, it's a bad idea.

 

That doesn't make sense. Right now there's no Credits being sold to use the API. By charging for the API, it could either remain the same, or go up. It literally could not go down.

Is there a bug? Report It | Not understanding game mechanics? Ask About It | Got a good idea? Suggest It

Forums Rules | Game Link

Link to comment
Share on other sites

That doesn't make sense. Right now there's no Credits being sold to use the API. By charging for the API, it could either remain the same, or go up. It literally could not go down.

True. On the flip side, people can just... not use the api.
  • Upvote 1

q8nfyvc.gif

Link to comment
Share on other sites

  • Administrators

True. On the flip side, people can just... not use the api.

 

Which, if anything, reduces the load on the server.

Is there a bug? Report It | Not understanding game mechanics? Ask About It | Got a good idea? Suggest It

Forums Rules | Game Link

Link to comment
Share on other sites

Which, if anything, reduces the load on the server.

 

When I learned about the API I thought that maybe you made it to reduce load on the server. Before someone told me about it I was automatically loading entire normal pages from the main website and extracting what I wanted with xpath. And before I learned how to do that I was just opening up hundreds of pages a day and sorting through them manually for the vital tasks like finding raid targets or keeping track of military numbers.

Link to comment
Share on other sites

To clarify: People will just use the old methods of getting the information. Which would in fact bog things down. No one will pay for a service when the information they are paying for is displayed freely already.

  • Upvote 2

q8nfyvc.gif

Link to comment
Share on other sites

I'm gonna put a different tone to this discussion because I get a little angry about this.

Pay for an API key? I don't think that's fair. You state that we get a lot of utility out of the API but that's not true. We do not get more utility then other, free users have. If we want to util that source, we have to make those utilities our selves. That's not for free: we have to invest time and effort to make them. What you try to do here is make money out of our own utilities that can exist without your API. Your benefit of an API is that we use a less resource intensive way. Our benefit is that it is a little easier to code something around that. So it is WIN/WIN. 

But the greed...

To be honest: I think this is a way to milk users and I really don't like this attitude. 
I think a lot of players already can't resist the temptation to not pay for in-game money for example.
I pay like $20 each month. And I'm just one user. How many of us pay for their credits?

Isn't that money enough for you?
 

If you gonna charge money for an API people then will use the scrape method to get info. 

I'm very sensitive about this greedy milking method as it sounds like a really cheap and greedy way to make more and more money. On top of that it is frustrating developers / coders. It's a step backward in time. You already got some basic API going. Putting up an API on it's own isn't really that hard.. Could be done within one day. No UI design is needed... you just spit out json,

Your server loads will drop so that means less costs...LESS. Not more. So what does justify a $5 each month for each API user then? You already make money out if it without people having to pay.

This is not the way to go I.M.O. and the proposed idea alone about this makes me feel worried about the whole game. 

Is the next road section still your passion to create and maintain this game or is it to make quick money?

Edited by niquedegraaff
Link to comment
Share on other sites

Only just noticed this topic.

 

If your servers are getting hit, it's likely because you haven't put much effort into structuring the API properly. Restructure the API, so we don't have to request as much data, and it will likely reduce your server load.

 

I personally have posted topics before asking for something approaching a proper structure to the API and they've basically been ignored.

https://politicsandwar.com/forums/index.php?/topic/11365-nation-api-layout-suggestion/

https://politicsandwar.com/forums/index.php?/topic/10558-alliance-api-layout-suggestion/

 

If you want an idea of how to implement an API properly, go buy yourself a copy of Guild Wars 2 and look at their (freely available) API.

 

Other suggestions include make available historical data, from your Stat Tracker. Also include timestamps for when the data was pulled (not just date). If this was available, alot of people probably wouldn't need to fetch and store historical data anymore.

 

Also make available Radiation as an API also (current and historical), that way I don't have to scrape the page to get the data.

 

Maybe, just maybe, if all this happens, then add in paid access for high rate limits. I'm talking people who want to pull 120 requests/minute or higher. But I would still keep free access available and limited by the minute, not daily.

 

If you implement your current proposal, you will also have to rate limit the game itself, to stop people from simply scraping the site. Personally, I'd just give up completely and quietly semi-retire from the game (much like I have with (That terrible game that is totally irrelevant and I shouldn't be bringing it up anyways)). Vast majority of the fun for me, is actually experimenting and playing around with the API data, for example working out efficient ways to build nations and cities, via simulations (my current project).

sig_cybernations.PNG.8d49a01423f488a0f1b846927f5acc7e.PNG

Link to comment
Share on other sites

  • 2 weeks later...

I'll quit this game if api costs money. !@#$ that.

☾☆

Priest of Dio

º¤ø„¤¤º°¨ ø„¸¸„¨ ø„¸¸„ø¤º°¨¨°º¤ø„¸¸„ø¤º°¨¨°º¤ø„¸

¨°º¤ø„¸ GOD EMPEROR DIO BRANDO¨°º¤ø„¸

¨°º¤ø„¸ DIO BRANDO GOD EMPEROR¨°º¤ø„¸

¨°º¤ø„¤¤º°¨ ø„¸¸„¨ ø„¸¸„ø¤º°¨¨°º¤ø„¸¸„ø¤º°¨¨°º¤ø„¸

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and the Guidelines of the game and community.