as it's not simple or "fast" to get access to OGames Report and Statistics API, I implemented a Proxy Server, as some may wan't to play with the API.
- Caching of reports retrieved by their api-id (kept for 1 week inside the cache)
- Caching of statistics retrieved by date+delta (kept for 5 minutes, as the info will change often)
- Ratelimiting, currently 5 requests per 60 seconds per IP-Address, but can be changed by the operator of the apiserver
- IPv6 compatible (the current API and all OGame Servers don't have this feature)
- Sending through the requesters real-ip using the "X-Forwarded-For" Header (-> which would enable GameForge blocking abusive use of the apiserver instead of invalidating the APIKEY)
- OpenSource, so everyone can host their own instance of it for caching and proxiing (-> gitlab.faw-kes.de/ogame/apiserver will be pushed to github aswell)
- One entrypoint for _all_ report types (Spy-, Combat-, Missile- and Recycle-Report)
- Every errormessage from OGames backend will get transmitted through, defective API-IDs of reports won't get cached as they could be available a few minutes later
This project was inspired by @NoMoreAngel s apireader.
Wan't to test? -> ogapi.rest/
Last but not least, the roadmap for the future:
- OGame Style REST-API points, so you'd just need to change your format string
- own APIKEY system for higher ratelimits for registered users (+ new Header with Userinformation -> which would enable GameForge blocking abusive use of the apiserver instead of invalidating the APIKEY)
- Testing if we can find more performance. Cached Access is at around 50ms, Access with Backendcall to OGame takes around 100ms (maybe php is too slow, maybe redis sucks, we will see)