{
  "openapi": "3.0.1",
  "info": {
    "title": "Sudoku & Star Battle Puzzle Generator (unique, graded)",
    "description": "Generates original sudoku and Star Battle puzzles, each proven to have exactly one solution and graded easy to expert by the techniques a logic solver needs. JSON, optional SVG, printable worksheets, or a 6x9 / 8.5x11 paperback book interior PDF with answer key.",
    "version": "0.2",
    "x-build-id": "ydAKLfeoHKfMfsbJf"
  },
  "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"
            ],
            "type": "string",
            "description": "sudoku = classic 9x9 sudoku. star-battle = place one crown per row, column and region, no two touching.",
            "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 only)",
            "type": "array",
            "description": "Star Battle grid sizes to use (6 to 10). Puzzles cycle through the sizes and difficulties you choose. Sudoku is always 9x9.",
            "default": [
              8
            ]
          },
          "difficulties": {
            "title": "Difficulty levels",
            "type": "array",
            "description": "Any of easy, medium, hard, expert, graded by the hardest technique a logic solver needs. 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 puzzles need 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 need a lookahead, hard at most one. Every Star Battle region has at least 3 cells and at most 28% of the grid.",
            "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 (coordinates, text and SVG) to every puzzle.",
            "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 2.5 to 12 KB to the dataset item (up to about 17 KB with the solution image).",
            "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.",
            "default": "sheets"
          },
          "title": {
            "title": "PDF title",
            "type": "string",
            "description": "Title printed on the first page of the PDF. Default: 'Sudoku Puzzles' or 'Star Battle 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}