Skip to content

Crossword Data File Format

Alexis Martel edited this page Nov 13, 2022 · 3 revisions

OpenCrossword fetches JSON files containing puzzle data in order to populate the grid and the info section of the solve page. Here's a look at an example JSON puzzle file, taken from the Mini Crossword #1 puzzle:

Example File

{
  "clues": {
    "across": {
      "1": "Possesses",
      "2": "What an interrupted owl might say?",
      "3": "With [4-Across], expected verdict to a wedding",
      "4": "See [3-Across]",
      "5": "Boat pole"
    },
    "down": {
      "3": "\"I think __ ready!\"",
      "6": "Western part of the globe (Abbr.)",
      "7": "Accepts visually",
      "8": "Inner chimney coating"
    }
  },
  "grid": [
    [
      {
        "clueNumber": 1,
        "answer": "o",
        "type": "cell"
      },
      {
        "clueNumber": 6,
        "answer": "w",
        "type": "cell"
      },
      {
        "clueNumber": 7,
        "answer": "n",
        "type": "cell"
      },
      {
        "clueNumber": 8,
        "answer": "s",
        "type": "cell"
      }
    ],
    [
      {
        "type": "block"
      },
      {
        "clueNumber": 2,
        "answer": "h",
        "type": "cell"
      },
      {
        "clueNumber": null,
        "answer": "o",
        "type": "cell"
      },
      {
        "clueNumber": null,
        "answer": "o",
        "type": "cell"
      }
    ],
    [
      {
        "clueNumber": 3,
        "answer": "i",
        "type": "cell"
      },
      {
        "type": "block"
      },
      {
        "clueNumber": 4,
        "answer": "d",
        "type": "cell"
      },
      {
        "clueNumber": null,
        "answer": "o",
        "type": "cell"
      }
    ],
    [
      {
        "clueNumber": 5,
        "answer": "m",
        "type": "cell"
      },
      {
        "clueNumber": null,
        "answer": "a",
        "type": "cell"
      },
      {
        "clueNumber": null,
        "answer": "s",
        "type": "cell"
      },
      {
        "clueNumber": null,
        "answer": "t",
        "type": "cell"
      }
    ]
  ],
  "info": {
    "title": "Mini #1",
    "author": "Alexis Martel",
    "description": "A small 4x4 crossword",
    "tags": [
      "mini",
      "unthemed"
    ],
    "date_published": "2022-07-09",
    "language": "en"
  }
}

We can see the file contains 4 main objects.

Clues

The clues object contains key-value pairs in which the key represents the clue number and the value represents the clue's text content. The across object contains the horizontal clues and the down object contains the vertical clues.

Grid

The grid is an array of arrays of objects (a two-dimensional array) in which the first array contains the grid as a whole, the second represents rows, and the object represents a puzzle square. If we take a look at a typical cell square, we'll have this:

{
  "clueNumber": 1,
  "answer": "o",
  "type": "cell"
}
  • 1 is the related clue's number (displayed in the top-left of the square);
  • "o" is the answer of that square;
  • "cell" is the type of that square.

Here is a typical block square:

{
  "type": "block"
}
  • "block" specifies the type of that square.

In addition to "cell" and "block", there is also "invisible", which makes the square invisible (it is ideal for non-rectangular puzzles that would otherwise contain too many blocks) and "circled", which displays a circle inside the square (Coming Soon!).

Info

The info object contains key-value pairs in which the key represents the information type, and the value, that information's text content. Here are the current supported info keys:

  • "title" specifies the puzzle's title;
  • "author" specifies the puzzle's creator;
  • "contact" specifies the author's email address;
  • "description" contains a description of the puzzle;
  • "tags" contains an array of related keywords;
  • "date_published" specifies the puzzle's date of publication (in ISO 8601 format);
  • "language" specifies the puzzle's language (in ISO 639.2 format).
Clone this wiki locally