A database of Factorio Recipes in JSON designed for HTML visualizations of the game's recipes. Recursive algorithms can be used to determine item dependancies. Of course, this repository has automated build, test, and deployment in honour of Factorio's style. 😄
Please note that the database is still under development, there may be signficant changes before the complete version is released
See the demo recipe browser here.
Recipe Data sourced from the Official Factorio Wiki and the official game's Lua recipe files. Send me pull requests if you find any inconsistencies or errors.
The database is a JSON list of all the recipes in the game. Recipe dependancies can be searched by their IDs. It also includes some item types like Resources (e.g. Iron) and Liquids (e.g. Water) to help recursive algorithms terminate properly. See Addtional Notes below for more information
You can use one of the two flavors of the database: Array or Dictionary. The Array list is the canonical used for development. The dictionary uses the id of the recipe as the key. Use one of the following links below to get the file for your project:
- Recipes as a List:
- Recipes as a dictionary:
CDN coming soon.
In JQuery, You can fetch the latest version of the JSON file from GitHub:
$.getJSON("https://kevinta893.github.io/factorio-recipes-json/recipes.min.json", function (json, err){
if (err != "success"){
console.log("Error cannot load json\n" + err);
return;
}
var recipesList = json;
//TODO your code here
});
In Node.js, you can synchronously or asynchronously get the file from your machine locally (synchronous example below):
var recipesList = JSON.parse(fs.readFileSync('recipes.json', 'utf8')); //synchronous
Field | Description |
---|---|
id | The internal name of the item |
name | The user friendly name |
type | The item type of the resulting item. One of: Machine, Resource, Liquid, Intermediate product, Item, Science Pack, Combat, Process, Tool, null |
wiki_link | A link to the Factorio Wiki |
recipe | The item's recipe (normal mode) |
recipe->ingredients | A list of ingredients to make the recipe, each ingredient has is an item with an id and amount. |
recipe->time | The factorio time to produce the object |
recipe->yield | The amount of the product produced by this recipe |
Here is a list of exceptions to take note of in the database:
- TBD
- The database can be recursively traced like a tree. For all recipes, the leaf nodes of the recipe tree will always end at an Resource or Liquid type. See the build-ci for a tool or example of how to accomplish this.
- More coming soon...