{"openapi":"3.1.0","info":{"title":"CraftGenie public API","version":"1.0.0","description":"Read-only access to the crafting data of the games on CraftGenie, and the factory planner.\n\n**Plan links (no tools needed).** To hand a user a finished, interactive factory, write a link: https://craftgenie.io/plan/{game}?make={item}:{rate}/min,{item}:{rate}/min (up to 20 targets; a bare number is a total), e.g. https://craftgenie.io/plan/satisfactory?make=heavy-modular-frame:10/min,computer:10/min,supercomputer:4/min. It plans as POST /plan does and redirects (302) to the plan's /p/ page; names are forgiving, and an unsure one opens a \"Did you mean…?\" page. Each game's page (https://craftgenie.io/games/{game}/factory) lists item slugs. See https://craftgenie.io/developers#plan-links.\n\n**Licensing.** Each game has its own data license, and every response about a game carries it in `license`. Credit the data with `license.attribution`. Where `license.commercial_use` is false (Core Keeper, Oxygen Not Included, Astroneer, Age of Empires IV, Warframe, EVE Online, Minecraft and Satisfactory), the data is for non-commercial use only, under `license.terms`. Some games on the site are not available through the API, because their data cannot be licensed for reuse.\n\n**Auth.** Anonymous access is allowed for reads and plans, with lower limits. Send an API key as `Authorization: Bearer cg_…` for higher limits and for POST /shares. Make one at https://craftgenie.io/account. Docs: https://craftgenie.io/developers.\n\n**Limits.** A plan body is at most 32768 bytes, with up to 20 targets and 8 grids. Responses carry X-RateLimit-Limit and X-RateLimit-Remaining; a 429 carries Retry-After.","contact":{"email":"contact@craftgenie.io"}},"servers":[{"url":"https://craftgenie.io/api/v1"}],"components":{"schemas":{"License":{"type":"object","properties":{"game":{"type":"string"},"access":{"type":"string","enum":["open","non-commercial"]},"commercial_use":{"type":"boolean"},"license":{"type":"string"},"license_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"share_alike":{"type":"boolean"},"attribution":{"type":"string"},"attribution_url":{"type":"string"},"notices":{"type":"array","items":{"type":"string"}},"credits":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"url":{"type":"string"},"author":{"type":"string"},"license":{"type":"string"},"license_url":{"type":"string"},"share_alike":{"type":"boolean"}},"required":["title","url","author","license","license_url","share_alike"]}},"terms":{"anyOf":[{"type":"string"},{"type":"null"}]},"terms_url":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["game","access","commercial_use","license","license_url","share_alike","attribution","attribution_url","notices","credits","terms","terms_url"],"description":"The game data's license. Credit it with `attribution`. When `commercial_use` is false the data is for non-commercial use only, under `terms` (see `terms_url`). When `share_alike` is true, share what you build from the data under the same license."},"ItemRef":{"type":"object","properties":{"item":{"type":"string"},"name":{"type":"string"}},"required":["item","name"]},"Item":{"type":"object","properties":{"item":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["item","workstation"]},"raw":{"type":"boolean"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"url":{"type":"string"}},"required":["item","name","kind","raw","description","url"]},"Recipe":{"type":"object","properties":{"id":{"type":"string"},"key":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"alternate":{"type":"boolean"},"outputs":{"type":"array","items":{"type":"object","properties":{"item":{"type":"string"},"name":{"type":"string"},"quantity":{"type":"number"}},"required":["item","name","quantity"]}},"slots":{"type":"array","items":{"type":"object","properties":{"quantity":{"type":"number"},"consumed":{"type":"boolean"},"options":{"type":"array","items":{"type":"object","properties":{"item":{"type":"string"},"name":{"type":"string"}},"required":["item","name"]}}},"required":["quantity","consumed","options"]}},"methods":{"type":"array","items":{"type":"object","properties":{"station":{"anyOf":[{"type":"object","properties":{"item":{"type":"string"},"name":{"type":"string"}},"required":["item","name"]},{"type":"null"}]},"seconds":{"type":"number"}},"required":["station","seconds"]}},"url":{"type":"string"}},"required":["id","key","name","alternate","outputs","slots","methods","url"]},"Game":{"type":"object","properties":{"game":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"production_style":{"type":"string","enum":["flow","batch"]},"counts":{"type":"object","properties":{"items":{"type":"integer"},"recipes":{"type":"integer"}},"required":["items","recipes"]},"url":{"type":"string"},"license":{"$ref":"#/components/schemas/License"}},"required":["game","name","description","production_style","counts","url","license"]},"RecipeList":{"type":"object","properties":{"total":{"type":"integer"},"recipes":{"type":"array","items":{"$ref":"#/components/schemas/Recipe"}}},"required":["total","recipes"]},"Guide":{"type":"object","properties":{"summary":{"anyOf":[{"type":"string"},{"type":"null"}]},"how_to_get":{"type":"array","items":{"type":"object","properties":{"method":{"type":"string","enum":["drop","location","gather","vendor","quest","craft","reward","other"]},"text":{"type":"string"},"where":{"anyOf":[{"type":"string"},{"type":"null"}]},"confidence":{"type":"string","enum":["high","medium","low"]},"sources":{"type":"array","items":{"type":"integer"}}},"required":["method","text","where","confidence","sources"]}},"tips":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"confidence":{"type":"string","enum":["high","medium","low"]},"sources":{"type":"array","items":{"type":"integer"}}},"required":["text","confidence","sources"]}},"sources":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"title":{"type":"string"},"publisher":{"anyOf":[{"type":"string"},{"type":"null"}]},"license":{"anyOf":[{"type":"string"},{"type":"null"}]},"accessed":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["url","title","publisher","license","accessed"]}},"game_version":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["summary","how_to_get","tips","sources","game_version","updated_at"]},"Amount":{"type":"object","properties":{"item":{"type":"string"},"name":{"type":"string"},"amount":{"type":"number"}},"required":["item","name","amount"]},"Plan":{"type":"object","properties":{"game":{"type":"string"},"open_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}],"description":"A short link (`https://craftgenie.io/p/{slug}`) that opens this exact factory in CraftGenie as a read-only page with its graph, production and power, which the user can explore and copy into their own factory to change and save. Give it to the user with the plan, copied exactly. The same plan always gets the same link. It is anonymous (no account owns it) and expires after 90 days unless opened. Null only for a plan too big to keep."},"mode":{"type":"string","enum":["perMinute","total"]},"per":{"type":"string"},"targets":{"type":"array","items":{"type":"object","properties":{"item":{"type":"string"},"name":{"type":"string"},"asked":{"type":"number"},"amount":{"type":"number"}},"required":["item","name","asked","amount"]}},"summary":{"type":"object","properties":{"text":{"type":"string"},"met":{"type":"boolean"},"scale":{"anyOf":[{"type":"number"},{"type":"null"}]},"recipes":{"type":"integer"},"idle_recipes":{"type":"integer"},"machines":{"type":"integer"},"raw_inputs":{"type":"integer"},"converged":{"type":"boolean"},"problems":{"type":"array","items":{"type":"string"}}},"required":["text","met","scale","recipes","idle_recipes","machines","raw_inputs","converged","problems"]},"entries":{"type":"array","items":{"type":"object","properties":{"recipe":{"type":"object","properties":{"id":{"type":"string"},"key":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}},"required":["id","key","name"]},"station":{"anyOf":[{"type":"object","properties":{"item":{"type":"string"},"name":{"type":"string"}},"required":["item","name"]},{"type":"null"}]},"machines":{"anyOf":[{"type":"number"},{"type":"null"}]},"built":{"anyOf":[{"type":"integer"},{"type":"null"}]},"crafts":{"type":"number"},"seconds":{"type":"number"},"grid":{"anyOf":[{"type":"string"},{"type":"null"}]},"outputs":{"type":"array","items":{"$ref":"#/components/schemas/Amount"}},"inputs":{"type":"array","items":{"type":"object","properties":{"item":{"type":"string"},"name":{"type":"string"},"amount":{"type":"number"},"consumed":{"type":"boolean"}},"required":["item","name","amount","consumed"]}},"fuel":{"$ref":"#/components/schemas/Amount"},"power":{"type":"number"},"generates":{"type":"number"}},"required":["recipe","station","machines","built","crafts","seconds","grid","outputs","inputs"]}},"machines":{"type":"array","items":{"type":"object","properties":{"item":{"type":"string"},"name":{"type":"string"},"count":{"type":"integer"}},"required":["item","name","count"]}},"raw_inputs":{"type":"array","items":{"$ref":"#/components/schemas/Amount"}},"surplus":{"type":"array","items":{"$ref":"#/components/schemas/Amount"}},"power":{"type":"array","items":{"type":"object","properties":{"grid":{"type":"string"},"unit":{"type":"string"},"text":{"type":"string"},"used":{"type":"number"},"capacity":{"type":"number"},"headroom":{"type":"number"},"unpowered":{"type":"boolean"},"overloaded":{"type":"boolean"}},"required":["grid","unit","text","used","capacity","headroom","unpowered","overloaded"]}},"license":{"$ref":"#/components/schemas/License"}},"required":["game","open_url","mode","per","targets","summary","entries","machines","raw_inputs","surplus","power","license"]},"GeneratedPlan":{"type":"object","properties":{"slug":{"type":"string"},"url":{"type":"string"},"game":{"type":"string"},"game_name":{"type":"string"},"title":{"type":"string"},"created_at":{"type":"string"},"document":{"type":"object","description":"The factory, checked against the game's current data, as the CraftGenie app shows it."},"dropped":{"type":"array","items":{"type":"string"},"description":"What the game no longer has and was left out, in words (\"2 recipes\"); empty when nothing was."},"license":{"$ref":"#/components/schemas/License"}},"required":["slug","url","game","game_name","title","created_at","document","dropped","license"]},"ListedPlan":{"type":"object","properties":{"slug":{"type":"string"},"url":{"type":"string","description":"The plan's short open link, /p/{slug}."},"title":{"type":"string","description":"Made from its targets (\"60 Electronic Circuit/min\")."},"game":{"type":"string"},"game_name":{"type":"string"},"opens_this_week":{"type":"integer","description":"People who opened it in the last seven days (one per visitor a day)."},"opens":{"type":"integer","description":"People who opened it since it was made."},"first_opened_at":{"type":"string"},"last_opened_at":{"type":"string"},"stats":{"anyOf":[{"type":"object","properties":{"machines":{"type":"number"},"recipes":{"type":"integer"},"items":{"type":"integer"},"power":{"anyOf":[{"type":"object","properties":{"used":{"type":"number"},"unit":{"type":"string"}},"required":["used","unit"]},{"type":"null"}]}},"required":["machines","recipes","items","power"]},{"type":"null"}]}},"required":["slug","url","title","game","game_name","opens_this_week","opens","first_opened_at","last_opened_at","stats"]},"PlanList":{"type":"object","properties":{"listed":{"type":"boolean","description":"Whether the list is public yet. Until enough plans have been opened, it is false and items is empty."},"sort":{"type":"string","enum":["popular","new"]},"game":{"anyOf":[{"type":"string"},{"type":"null"}]},"items":{"type":"array","items":{"$ref":"#/components/schemas/ListedPlan"}}},"required":["listed","sort","game","items"]},"Share":{"type":"object","properties":{"url":{"type":"string"},"share":{"type":"string"},"factory":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"plan":{"$ref":"#/components/schemas/Plan"},"license":{"$ref":"#/components/schemas/License"}},"required":["url","share","factory","plan","license"]},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["code","message"]}},"required":["error"]},"PlanRequest":{"type":"object","properties":{"game":{"type":"string","minLength":1,"maxLength":200,"description":"The game slug, as list_games or GET /api/v1/games returns it."},"targets":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"item":{"type":"string","minLength":1,"maxLength":200,"description":"The item slug, as search_items or GET …/items returns it."},"rate":{"description":"Items per minute (mode perMinute).","type":"number","exclusiveMinimum":0,"maximum":1000000},"quantity":{"description":"Items in total (mode total).","type":"number","exclusiveMinimum":0,"maximum":10000000}},"required":["item"],"additionalProperties":false}},"options":{"type":"object","properties":{"mode":{"description":"perMinute (rates) or total (quantities). Defaults to what the targets give.","type":"string","enum":["perMinute","total"]},"recipes":{"type":"object","properties":{"prefer":{"description":"Recipes (id or key) placed first; the planner builds the rest around them.","maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"allow":{"description":"Unlockable recipes (alternates) the player has, by id or key, or \"all\". Default: none.","anyOf":[{"type":"string","const":"all"},{"maxItems":2000,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}]},"block":{"description":"Recipes (id or key) the planner must not pick.","maxItems":2000,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"additionalProperties":false},"grids":{"description":"Power grids, Main first. Default: one grid, Main.","minItems":1,"maxItems":8,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"items":{"description":"Electric machines whose main output is one of these items go on this grid.","maxItems":500,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"stations":{"description":"Electric machines of these workstations (by slug) go on this grid.","maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"generator":{"description":"The generator recipe (id or key) that powers this grid, when not the planner's pick.","type":"string","minLength":1,"maxLength":200},"fuel":{"description":"The item that generator burns.","type":"string","minLength":1,"maxLength":200}},"required":["name"],"additionalProperties":false}},"energy":{"description":"false leaves fuel and power out of the plan. Default true.","type":"boolean"}},"additionalProperties":false}},"required":["game","targets"],"additionalProperties":false},"ShareRequest":{"type":"object","properties":{"game":{"type":"string","minLength":1,"maxLength":200,"description":"The game slug, as list_games or GET /api/v1/games returns it."},"targets":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"item":{"type":"string","minLength":1,"maxLength":200,"description":"The item slug, as search_items or GET …/items returns it."},"rate":{"description":"Items per minute (mode perMinute).","type":"number","exclusiveMinimum":0,"maximum":1000000},"quantity":{"description":"Items in total (mode total).","type":"number","exclusiveMinimum":0,"maximum":10000000}},"required":["item"],"additionalProperties":false}},"options":{"type":"object","properties":{"mode":{"description":"perMinute (rates) or total (quantities). Defaults to what the targets give.","type":"string","enum":["perMinute","total"]},"recipes":{"type":"object","properties":{"prefer":{"description":"Recipes (id or key) placed first; the planner builds the rest around them.","maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"allow":{"description":"Unlockable recipes (alternates) the player has, by id or key, or \"all\". Default: none.","anyOf":[{"type":"string","const":"all"},{"maxItems":2000,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}]},"block":{"description":"Recipes (id or key) the planner must not pick.","maxItems":2000,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"additionalProperties":false},"grids":{"description":"Power grids, Main first. Default: one grid, Main.","minItems":1,"maxItems":8,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"items":{"description":"Electric machines whose main output is one of these items go on this grid.","maxItems":500,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"stations":{"description":"Electric machines of these workstations (by slug) go on this grid.","maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"generator":{"description":"The generator recipe (id or key) that powers this grid, when not the planner's pick.","type":"string","minLength":1,"maxLength":200},"fuel":{"description":"The item that generator burns.","type":"string","minLength":1,"maxLength":200}},"required":["name"],"additionalProperties":false}},"energy":{"description":"false leaves fuel and power out of the plan. Default true.","type":"boolean"}},"additionalProperties":false},"name":{"type":"string","minLength":1,"maxLength":120}},"required":["game","targets"],"additionalProperties":false}},"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"An API key, cg_…"}}},"security":[{},{"apiKey":[]}],"paths":{"/games":{"get":{"summary":"List the games","operationId":"listGames","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Game"}}},"required":["items"]}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/games/{game}":{"get":{"summary":"One game, and what the planner supports there","operationId":"getGame","parameters":[{"name":"game","in":"path","required":true,"schema":{"type":"string"},"description":"The game slug, from GET /games."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Game"},{"type":"object","properties":{"planner":{"type":"object","properties":{"modes":{"type":"array","items":{"type":"string"}},"default_mode":{"type":"string"},"power_grid":{"type":"boolean"},"fuel":{"type":"boolean"},"power_unit":{"anyOf":[{"type":"string"},{"type":"null"}]},"unlockable_recipes":{"anyOf":[{"type":"object","properties":{"label":{"type":"string"}},"required":["label"]},{"type":"null"}]}},"required":["modes","default_mode","power_grid","fuel","power_unit","unlockable_recipes"]}},"required":["planner"]}]}}}},"404":{"description":"No such game (unknown, unpublished, or not served by the API), item or recipe","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/games/{game}/items":{"get":{"summary":"Search items by name or slug","operationId":"searchItems","parameters":[{"name":"game","in":"path","required":true,"schema":{"type":"string"},"description":"The game slug, from GET /games."},{"name":"q","in":"query","schema":{"type":"string"},"description":"Part of a name or slug"},{"name":"kind","in":"query","schema":{"type":"string","enum":["item","workstation"]}},{"name":"raw","in":"query","schema":{"type":"string","enum":["true","false"]}},{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Item"}},"page":{"type":"integer"},"limit":{"type":"integer"},"total":{"type":"integer"},"license":{"$ref":"#/components/schemas/License"}},"required":["items","page","limit","total","license"]}}}},"400":{"description":"The request is invalid (`VALIDATION`, with `issues`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such game (unknown, unpublished, or not served by the API), item or recipe","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/games/{game}/items/{item}":{"get":{"summary":"One item, with how to get it, what makes it and what uses it","description":"guide is null unless CraftGenie has a how-to-get guide for the item; each line cites guide.sources by index (0-based), and each source carries its own license. license is the game data's.","operationId":"getItem","parameters":[{"name":"game","in":"path","required":true,"schema":{"type":"string"},"description":"The game slug, from GET /games."},{"name":"item","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"item":{"$ref":"#/components/schemas/Item"},"guide":{"anyOf":[{"$ref":"#/components/schemas/Guide"},{"type":"null"}]},"produced_by":{"$ref":"#/components/schemas/RecipeList"},"used_in":{"$ref":"#/components/schemas/RecipeList"},"crafted_here":{"$ref":"#/components/schemas/RecipeList"},"license":{"$ref":"#/components/schemas/License"}},"required":["item","guide","produced_by","used_in","license"]}}}},"404":{"description":"No such game (unknown, unpublished, or not served by the API), item or recipe","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/games/{game}/recipes":{"get":{"summary":"Search recipes by what they make, take or are made at","operationId":"searchRecipes","parameters":[{"name":"game","in":"path","required":true,"schema":{"type":"string"},"description":"The game slug, from GET /games."},{"name":"item","in":"query","schema":{"type":"string"},"description":"An item slug"},{"name":"role","in":"query","schema":{"type":"string","enum":["output","input","station"],"default":"output"}},{"name":"q","in":"query","schema":{"type":"string"},"description":"Part of the recipe name"},{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Recipe"}},"page":{"type":"integer"},"limit":{"type":"integer"},"total":{"type":"integer"},"license":{"$ref":"#/components/schemas/License"}},"required":["items","page","limit","total","license"]}}}},"400":{"description":"The request is invalid (`VALIDATION`, with `issues`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such game (unknown, unpublished, or not served by the API), item or recipe","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/games/{game}/recipes/{recipe}":{"get":{"summary":"One recipe, by id or key","operationId":"getRecipe","parameters":[{"name":"game","in":"path","required":true,"schema":{"type":"string"},"description":"The game slug, from GET /games."},{"name":"recipe","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"recipe":{"$ref":"#/components/schemas/Recipe"},"license":{"$ref":"#/components/schemas/License"}},"required":["recipe","license"]}}}},"404":{"description":"No such game (unknown, unpublished, or not served by the API), item or recipe","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/plan":{"post":{"summary":"Plan a factory","description":"Runs the CraftGenie planner: the recipes in `options.recipes.prefer` first, then Fill in the whole chain, power for each grid, and a final solve. The `open_url` in the answer is a short link that opens the plan in CraftGenie as an interactive factory, with no key and no account. Example: `{\"game\":\"factorio\",\"targets\":[{\"item\":\"electronic-circuit\",\"rate\":60}]}`.","operationId":"plan","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Plan"}}}},"400":{"description":"The request is invalid (`VALIDATION`, with `issues`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such game (unknown, unpublished, or not served by the API), item or recipe","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The body is too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The planner is busy (`PLAN_BUSY`) or the plan timed out (`PLAN_TIMEOUT`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/plans":{"get":{"summary":"Factories people are planning","description":"Generated plans (every plan's open_url) that a person opened on the CraftGenie site, as /plans lists them. Only opens from the site's own /p/ page in a browser count, once per visitor a day; reading a plan through this API does not. `popular` ranks by opens in the last seven days, then the most recently first opened; `new` by the most recently first opened. At most 50, and at most three of one game unless `game` names it. Empty, with `listed: false`, until enough plans have been opened. Plans hold only game data: no caller text. Cached for a minute.","operationId":"listPlans","parameters":[{"name":"sort","in":"query","required":false,"schema":{"type":"string","enum":["popular","new"],"default":"popular"}},{"name":"game","in":"query","required":false,"description":"One game, by slug: its plans, with no per-game cap.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanList"}}}},"400":{"description":"The request is invalid (`VALIDATION`, with `issues`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such game","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/plans/{slug}":{"get":{"summary":"A generated plan, as its open_url shows it","description":"What `/p/{slug}` (a plan's `open_url`) opens. Each read keeps the link alive for another 90 days, so it is not cached; reading it here does not count toward the public list of opened plans (listPlans), which only the site's own page does. An unknown or expired slug is a 404.","operationId":"getPlan","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeneratedPlan"}}}},"404":{"description":"No such plan, or it expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/shares":{"post":{"summary":"Plan a factory and save it as an unlisted share link","description":"Needs an API key. The factory is saved to the key's account, shared by an unguessable link, and listed among the account's factories, where it can be renamed, unpublished or deleted.","operationId":"createShare","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShareRequest"}}}},"responses":{"201":{"description":"Saved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Share"}}}},"400":{"description":"The request is invalid (`VALIDATION`, with `issues`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No API key, or an unknown or revoked one","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such game (unknown, unpublished, or not served by the API), item or recipe","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}