api-ninjas-com Sudoku API

The Sudoku API allows you to generate and solve Sudoku puzzles of various sizes and difficulty levels.

Operations 2

GET /v1/sudokugenerate Generate a new Sudoku puzzle #
POST /v1/sudokusolve Solve an existing Sudoku puzzle #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/api-ninjas-com:api-ninjas-com-sudoku-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

api-ninjas-com-sudoku-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Ninjas Sudoku API
  description: 'Combined OpenAPI specification for every API Ninjas endpoint. Requests go to https://api.api-ninjas.com with an `X-Api-Key` header; get a free key at https://api-ninjas.com/register. Human-readable docs: https://api-ninjas.com/api. Index for LLMs: https://api-ninjas.com/llms.txt.'
  version: 1.0.0
  contact:
    name: API Ninjas
    url: https://api-ninjas.com
  license:
    name: Proprietary
servers:
- url: https://api.api-ninjas.com
  description: API Ninjas Production
security:
- ApiKeyAuth: []
tags:
- name: Sudoku
  description: The Sudoku API allows you to generate and solve Sudoku puzzles of various sizes and difficulty levels.
paths:
  /v1/sudokugenerate:
    get:
      summary: Generate a new Sudoku puzzle
      description: Generates a new Sudoku puzzle at a chosen box width, height, difficulty and optional seed for reproducible output. To solve an existing puzzle use /sudokusolve.
      operationId: generateSudoku
      parameters:
      - name: width
        in: query
        description: Width of each box in the Sudoku grid. Default is 3. Must be between 2 and 4.
        required: false
        schema:
          type: integer
          default: 3
          minimum: 2
          maximum: 4
      - name: height
        in: query
        description: Height of each box in the Sudoku grid. Default is 3. Must be between 2 and 4.
        required: false
        schema:
          type: integer
          default: 3
          minimum: 2
          maximum: 4
      - name: difficulty
        in: query
        description: 'Difficulty level of the puzzle. Possible values: easy, medium, hard. Default is medium.'
        required: false
        schema:
          type: string
          default: medium
          enum:
          - easy
          - medium
          - hard
      - name: seed
        in: query
        description: Seed value for reproducible puzzle generation.
        required: false
        schema:
          type: string
      responses:
        '200':
          description: A Sudoku puzzle and its solution
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SudokuResponse'
      security:
      - ApiKeyAuth: []
      tags:
      - Sudoku
  /v1/sudokusolve:
    post:
      summary: Solve an existing Sudoku puzzle
      description: Solves a Sudoku puzzle supplied in the request body. Requires the grid's box `width` and `height`. To create a new puzzle instead use /sudokugenerate.
      operationId: solveSudoku
      parameters:
      - name: width
        in: query
        description: Width of each box in the Sudoku grid. Must be between 2 and 4.
        required: true
        schema:
          type: integer
          minimum: 2
          maximum: 4
      - name: height
        in: query
        description: Height of each box in the Sudoku grid. Must be between 2 and 4.
        required: true
        schema:
          type: integer
          minimum: 2
          maximum: 4
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Puzzle'
      responses:
        '200':
          description: The solution of the Sudoku puzzle
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SolveResponse'
      security:
      - ApiKeyAuth: []
      tags:
      - Sudoku
components:
  schemas:
    SolveResponse:
      type: object
      properties:
        status:
          type: string
          enum:
          - solved
        solution:
          $ref: '#/components/schemas/Solution'
    Solution:
      type: array
      items:
        type: array
        items:
          type: integer
          minimum: 1
          maximum: 9
    Puzzle:
      type: array
      items:
        type: array
        items:
          type:
          - integer
          - 'null'
          minimum: 0
          maximum: 9
    SudokuResponse:
      type: object
      properties:
        puzzle:
          $ref: '#/components/schemas/Puzzle'
        solution:
          $ref: '#/components/schemas/Solution'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
externalDocs:
  description: API Ninjas documentation
  url: https://api-ninjas.com/api