I'm trying to make a website that calculates your win rate based on what character you are using. When I try to access api.cardhunter.com/battles, it works fine (although really slow). When I try to access api.cardhunter.com/characters though, the server returns proxy error. I tried api.cardhunter.com/items just to test whether the api works, and the server returned proxy error too. What is the problem? Thanks
Items hasn't really worked since the API was launched. I believe they're just holding off until the new API update is ready to go, which should hopefully be soon.
Yeah, it's a load issue. On the live server the query to collect this data takes so long that the API request times out. On the test server there's only a tiny amount of data, so the queries run quickly and these parts of the API work as intended. Still, you can do a lot with the parts that do work (eg the entire META site, guilds etc), and I don't think the possibilities have been exhausted yet.
My particular use-case was an interface to view the items that were used in a battle. Are there any circumstances where such a query might complete in a reasonable amount of time (recent battles only, filtering by battle_id, etc)?
This is the part I never understood. You have an aws backend, there shouldn't be a problem storing the data in S3 and writing a dedicated app using the sdk to run queries without causing latency issues. Once done, simply push the data store from s3 to redshift for archiving. The whole process is scalable and flexible. Take the queried results from the app and store to another bucket in s3 for api usage. Alternatively, you could also create an EBS volume for persistent storage and use aws database (dynamoDB/rds) to tabulate the data etc etc... So many ways to do big data analysis using cloud solutions, shrugs.
Would it be possible for the webpage (http://api.cardhunter.com/) to mention which methods are too slow to be usable? I spent time setting up a database and writing code only to find out that what I wanted to do is not possible. A big WARNING or NOTE or DANGER WILL ROBINSON would suffice, wrapped in <marquee> and <blink>.