apyhub
SMART GENERATION

PlaySocket Puzzle & Brain Games API

What it does

PlaySocket Game Generator gives you a GraphQL endpoint that creates puzzle and brain-game boards for Sudoku, Schulte Table, and Stroop Table use cases. Send a query in body.query, and optionally pass body.variables and body.operationName when your GraphQL document uses variables or multiple named operations.

For Sudoku, newSudokuBoard returns a wrapper with results, message, and grids. Each grid includes a value 2D array for the puzzle, a solution 2D array for the solved board, and a difficulty value of EASY, MEDIUM, or HARD. This makes it useful when you need generated puzzle content for games, training exercises, or quiz-style experiences.

For Schulte Tables, newSchulteTable returns a message and a randomized schulteBoard 2D integer grid sized according to the request. You can use it anywhere you need a generated layout for attention, timing, visual search, or brain-training gameplay.

For the Stroop Test, newStroopTable generates a randomized Stroop Table board based on the requested size and difficulty. It returns a stroopBoard containing color entries, where each entry provides a colorName and its actualColor. This allows you to create cognitive-training gameplay that tests attention, response inhibition, and cognitive flexibility.

The response is GraphQL-shaped: successful payloads come back under data, while validation or execution issues appear in errors with optional path and locations.

Use PlaySocket Game Generator when your application needs dynamically generated puzzle, attention, and brain-training game content without having to build the underlying generation logic yourself.

POST
Generate Sudoku & Schulte Board
https://api.eu.apyhub.com/gyanesh5009/playsocket-game-engine/api/games

QUICKSTART

GUIDE

Quickstart

Run a GraphQL query to generate a Sudoku board, Schulte Table, or Stroop Test table.

Generate a Sudoku Board

curl -X POST "https://api.eu.apyhub.com/gyanesh5009/playsocket-game-engine/api/games" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "query { newSudokuBoard(limit: 1, difficulty: \"HARD\", size: 9) { grids { value solution difficulty } results message } }"
  }'

Generate a Schulte Table

curl -X POST "https://api.eu.apyhub.com/gyanesh5009/playsocket-game-engine/api/games" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "query { newSchulteTable(size: 5) { schulteBoard message } }"
  }'

Generate a Stroop Test

curl -X POST "https://api.eu.apyhub.com/gyanesh5009/playsocket-game-engine/api/games" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "query { newStroopTable(size: 5, difficulty: \"HARD\") { stroopBoard { colorName actualColor } difficulty message } }"
  }'

What you'll get back

The API returns a JSON object with optional data and errors fields. On success, data contains the result of the selected GraphQL query.

Sudoku Response

The newSudokuBoard field contains grids, an array of generated puzzle objects, results, the number of grids returned, and message, a status string.

{
  "data": {
    "newSudokuBoard": {
      "grids": [
        {
          "value": [["1", " ", "3"]],
          "solution": [["1", "2", "3"]],
          "difficulty": "HARD"
        }
      ],
      "results": 1,
      "message": "Data fetched successfully."
    }
  }
}

Schulte Table Response

The newSchulteTable field contains schulteBoard, a two-dimensional array of integers, and message.

{
  "data": {
    "newSchulteTable": {
      "schulteBoard": [
        [1, 8, 15, 22, 9],
        [19, 4, 12, 25, 2],
        [7, 21, 14, 5, 18],
        [23, 10, 3, 16, 24],
        [11, 6, 20, 13, 17]
      ],
      "message": "Data fetched successfully."
    }
  }
}

Stroop Test Response

The newStroopTable field contains stroopBoard, a two-dimensional array of Color objects. Each color object contains colorName and actualColor, along with the selected difficulty and a status message.

{
  "data": {
    "newStroopTable": {
      "stroopBoard": [
        [
          {
            "colorName": "RED",
            "actualColor": "BLUE"
          },
          {
            "colorName": "GREEN",
            "actualColor": "GREEN"
          }
        ],
        [
          {
            "colorName": "BLUE",
            "actualColor": "RED"
          },
          {
            "colorName": "YELLOW",
            "actualColor": "GREEN"
          }
        ]
      ],
      "difficulty": "HARD",
      "message": "Data fetched successfully."
    }
  }
}

Available GraphQL Queries

QueryParametersReturns
newSudokuBoardlimit, difficulty, sizeSudoku puzzle grids
newSchulteTablesizeSchulte Table
newStroopTablesize, difficultyStroop Test table

All three games can be requested through the same PlaySocket GraphQL Gateway by selecting the appropriate query and fields.

TRY ITLIVE · 3 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.

About this endpoint

What it does

Executes a GraphQL query against the PlaySocket GraphQL Gateway and returns the corresponding GraphQL response payload.

The API supports PlaySocket's Classical Games and Brain Games, including Sudoku, Schulte Table, and Stroop Test.

The request body must include a GraphQL query and can optionally include variables and operationName.

Request Body

ParameterTypeMandatoryDescription
queryStringYesThe GraphQL query document to execute.
variablesObjectNoOptional map of GraphQL variables referenced in the query. Nullable.
operationNameStringNoOptional name of the operation to execute when the query contains multiple named operations. Nullable.

Response

Returns a JSON object containing nullable data and errors fields.

When the query succeeds, data can contain newSudokuBoard, newSchulteTable, and/or newStroopTable, depending on the fields selected in the GraphQL query.

ParameterTypeMandatoryDescription
dataObjectNoNullable response container containing the requested GraphQL payload, such as newSudokuBoard, newSchulteTable, or newStroopTable.
errorsObject ArrayNoNullable array of GraphQL error objects, present when query execution fails.

Supported Games

  • Sudoku — Generates a new Sudoku board.
  • Schulte Table — Generates a new Schulte Table for visual attention and speed training.
  • Stroop Table — Generates a Stroop Table for testing cognitive flexibility and response inhibition.

Body

Name
Type
Description
bodyREQUIRED
object
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.