{
  "openapi": "3.0.1",
  "info": {
    "title": "Sudoku, Star Battle, Takuzu, Futoshiki & Nonogram Generator",
    "description": "Generates original sudoku, Star Battle, Takuzu, Futoshiki, Nonogram and English logic grid (zebra) puzzles, each proven to have exactly one solution and graded by technique or size. JSON, optional SVG, printable worksheets, or a 6x9 / 8.5x11 paperback interior PDF with answer key.",
    "version": "0.5",
    "x-build-id": "QLDuMdw32ZfVWb1h6"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ars-technis~logic-puzzle-generator/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ars-technis-logic-puzzle-generator",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/ars-technis~logic-puzzle-generator/runs": {
      "post": {
        "operationId": "runs-sync-ars-technis-logic-puzzle-generator",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/ars-technis~logic-puzzle-generator/run-sync": {
      "post": {
        "operationId": "run-sync-ars-technis-logic-puzzle-generator",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "puzzleType": {
            "title": "Puzzle type",
            "enum": [
              "sudoku",
              "star-battle",
              "takuzu",
              "futoshiki",
              "nonogram",
              "logic-grid"
            ],
            "type": "string",
            "description": "sudoku = classic 9x9 sudoku. star-battle = place one crown per row, column and region, no two touching. takuzu = fill a grid with 0 and 1: no three equal digits side by side, as many 0s as 1s per row and column, no two rows or columns alike (also called Binairo or binary puzzle). futoshiki = fill an N x N grid with 1 to N, each once per row and column, so that every inequality sign between neighbouring cells holds. nonogram = shade cells so that every row and column shows its clue's runs of shaded cells, in order (also called Picross or Griddlers); the patterns are random, not pictures. logic-grid = English logic grid (zebra) puzzle: a short story, 3 or 4 people and clues; readers mark yes and no in a grid.",
            "default": "sudoku"
          },
          "count": {
            "title": "Number of puzzles",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "How many puzzles to generate. You are charged per delivered puzzle.",
            "default": 10
          },
          "sizes": {
            "title": "Grid sizes (Star Battle, Takuzu, Futoshiki, Nonogram)",
            "type": "array",
            "description": "Grid sizes. Star Battle: 6 to 10 (default 8). Takuzu: 6, 8, 10 or 12 (default 8). Futoshiki: 5, 6 or 7 (default 5). Nonogram: 5, 10 or 15 (default 10). Leave empty for the default. Puzzles cycle through the sizes and difficulties you choose. Sudoku is always 9x9. Logic grids ignore sizes: the difficulty sets the grid."
          },
          "difficulties": {
            "title": "Difficulty levels",
            "type": "array",
            "description": "Any of easy, medium, hard, expert, graded by the techniques our logic solver uses (for Star Battle and Futoshiki hard and expert, also by how many lookaheads). Sudoku: easy = singles only; medium = pointing/claiming; hard = pairs and triples; expert = X-wing or swordfish. Star Battle: easy = singles and covers (a cell that sees every candidate of a row, column or region is ruled out); medium = adds region/row counting sets; hard = a counting set of three or more regions (or rows or columns), three or more counting steps, or one lookahead (most hard solutions use no lookahead); expert = two or more lookaheads. A lookahead is a one-step trial: assume a crown, follow singles and covers, and rule the cell out if a row, column or region is left empty. Easy and medium never use a lookahead, hard at most one. Every Star Battle region has at least 3 cells and at most 28% of the grid. Takuzu: easy = pairs; medium = adds counts; hard = adds line completion (a cell takes the same digit in every valid way to complete its line); expert = adds a one-step lookahead. Futoshiki: easy = singles and inequality bounds; medium = adds pairs or triples; hard = one or two lookaheads; expert = three or more. Nonogram (easy, medium, hard only): easy = simple boxes and spaces (compare each run's leftmost and rightmost place in its line); medium = full line logic (every arrangement of a line that fits what is known); hard = also one-step lookaheads. Logic grid: easy = 3 people and 2 groups, medium = 4 and 2, hard = 4 and 3 (no expert); at most 50 easy ones per run.",
            "items": {
              "type": "string",
              "enum": [
                "easy",
                "medium",
                "hard",
                "expert"
              ],
              "enumTitles": [
                "Easy",
                "Medium",
                "Hard",
                "Expert"
              ]
            },
            "default": [
              "easy",
              "medium",
              "hard"
            ]
          },
          "includeSolution": {
            "title": "Include solutions",
            "type": "boolean",
            "description": "Add the solution (the full grid or, for Star Battle, the crown coordinates; as text, and as SVG when svg is on) to every puzzle. For a logic grid: a table of who has what.",
            "default": true
          },
          "svg": {
            "title": "SVG images",
            "type": "boolean",
            "description": "Add a ready-to-embed SVG of the puzzle (and of the solution) to every item. Off by default: each SVG adds about 1.5 to 21 KB per image (measured: a 6x6 Takuzu puzzle about 1.5 KB, a 12x12 Takuzu solution about 18 to 19 KB, a hard logic grid solution about 21 KB).",
            "default": false
          },
          "palette": {
            "title": "SVG colours (Star Battle)",
            "enum": [
              "color",
              "grayscale"
            ],
            "type": "string",
            "description": "Region colours in the SVG images.",
            "default": "color"
          },
          "pdf": {
            "title": "Printable PDF",
            "type": "boolean",
            "description": "Also build a printable PDF (layout below) and save it to the run's key-value store as puzzles.pdf.",
            "default": false
          },
          "pdfLayout": {
            "title": "PDF layout",
            "enum": [
              "sheets",
              "book-8.5x11",
              "book-6x9"
            ],
            "type": "string",
            "description": "Worksheets: US Letter, two puzzles per page, solutions at the back. Book interior: a paperback interior with no bleed at 6x9 in or 8.5x11 in: title page, rules page, one puzzle per page, solutions at the back, page numbers, embedded fonts, grayscale, an even page count, and an inside margin set from the page count by KDP's paperback table. KDP paperbacks need at least 24 pages, so ask for 20 puzzles or more. You add your own cover. Logic grids: worksheets only, one puzzle per page with its story and clues.",
            "default": "sheets"
          },
          "title": {
            "title": "PDF title",
            "type": "string",
            "description": "Title printed on the first page of the PDF. Default: 'Sudoku Puzzles', 'Star Battle Puzzles', 'Takuzu Puzzles', 'Futoshiki Puzzles' 'Nonogram Puzzles' or 'Logic Grid Puzzles'."
          },
          "seed": {
            "title": "Random seed",
            "type": "integer",
            "description": "Optional. The same seed and settings give the same puzzles again. Leave empty for fresh puzzles every run."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}