What is the "Resources API"?
The term "API" stands for "application programming interface". APIs generally enable the easy exchange of data and/or functions between different applications. The Resources API allows you to retrieve your own current player data, as well as other up-to-date game data, almost in real-time and analyze it using your own tools (or third-party tools).
The API provides data either as CSV or JSON. Thanks to the API, you can keep your Excel or Google spreadsheets up-to-date with very little effort. There are already tools that will support the API, allowing for very interesting analyses regarding profitability, price trends, etc. (see Communities & Tools)
Who is the API suitable for?
The API is particularly beneficial for all math and statistics enthusiasts who already manage their complex evaluation tables for their own and the entire resources economy. And of course, for all app/web developers who want to develop a great tool or information platform.
Those who are not fans of Excel/Google Sheets or databases, or are generally not very ambitious in processing and presenting raw data, should wait until appropriate, ready-made tools or spreadsheets are available to the public.
Please note...
... that if you entrust your API keys to a third-party tool, the developer of this tool can read or even store your API key. It is up to you to decide whom/which platform you trust your key with. Even though no sensitive data such as email, passwords, or current positions can be read via the API, and the API key has no further use or account-related connection besides API queries (and most data could also be assembled via the Resources app), it would not be advantageous if your API keys fell into the wrong hands, and your API credits were used up within minutes for unexplained reasons or your data was otherwise misused.
How do I gain access to the API?
By purchasing so-called "API credits" in the InApp store, you receive your own API key and a certain number of API credits via registration email, which you can use to query the data. Each query costs one "API credit".
But what exactly is a query?
With a query, you can, for example, get a list with current and detailed information about all your production facilities. Or a list of your storage levels and storage stages. Or your protocol of your last purchases and sales on the market within the last 30 days, or... or ...
What data can I query?
The API is expected to be extended with a few more queries. Currently, the following queries are possible:
- Number of remaining API credits (this query naturally costs no API credits!)
- List of your factories, factory levels, and status
- Your storage levels, storage stages, and account balance
- List of your special buildings and levels
- Your HQ progress
- List of your production facilities with condition, boost, TU factor, attack penalty, etc.
- Summary of production facility data by extracted resources
- Your trading log of the last x days (max. 30 days)
- Player info such as points, level, world rank, registration date
- Balance info (income and expenses per day, max. last 30 days)
- Attack log
- External maintenance log
- ID list including icon for all resources items, factories, special buildings, and production facilities, including names in all client languages
- Basic production data
- Basic recycling data
- Basic factory upgrade costs data
- Basic special building upgrade costs data
- Current AI and market prices (almost in real-time)
How do I query?
The query is very simple with a query URL and GET parameters.