# For developers & agents

> A deterministic interface that runs on your device. The visible game makers call the same code.

[JSON Schema · v1](https://paperoom.yunusemrevurgun.com/api/schema.json) · [JSON examples](https://paperoom.yunusemrevurgun.com/api/examples.json) · [JSON result](https://paperoom.yunusemrevurgun.com/api/sample-word-search.json) · [ES module](https://paperoom.yunusemrevurgun.com/assets/api.mjs)

## How to use it

Import the public ES module in a browser module, or download api.mjs, generators.mjs and locales.mjs together for a JavaScript runtime with Intl.Segmenter. No key, account, paid inference or server request is required to generate a game.

```js
import {generate} from '/assets/api.mjs';
const result = generate({
  tool: 'word-search', language: 'en', seed: 'garden-42',
  settings: {text: 'GARDEN\nFLOWER\nTREE', size: 12,
    difficulty: 'easy', includeKey: true}
});
console.log(result.pack.grid, result.pack.placements);
```

## Inputs and output

tool: bingo, tombala, word-search or cards. language: en, es, ar, pt, zh or fr. seed: 1–64 characters. settings: optional overrides; see the schema and examples. Numbers may use JSON numbers. Booleans must be true/false. Defaults are localized. The result includes the resolved settings, stable set id and pack: cards/caller, or grid/placements/words. Placement r and c are zero-based; dr and dc are row/column steps. GameError exposes code and data. Invalid input fails without silently dropping words.

## Reproducibility and stable links

The same v1 code, seed, language and settings produce the same result. Keep the version and inputs with saved output; future algorithm versions may differ. Stable links accept seed and scalar controls only. Custom words never need to enter a URL. Use JSON setup files for custom content. The library processes supplied content as data, with the same limits as the form.

[BINGO · seed=paperoom-demo](https://paperoom.yunusemrevurgun.com/bingo/?mode=75&count=8&seed=paperoom-demo)

## Local PDF export

In a browser, import createPDF from /assets/pdf.mjs and locales from /assets/locales.mjs. Pass {pack:result.pack, current:{...result.settings,id:result.id}, tool:result.tool,t:locales[result.language]}, then call doc.save("games.pdf"). It downloads self-hosted PDF code and font files on demand. It sends no game content. Print output and PDF layout are separate renderers of the same pack.

## Every printable game

The same generate() call covers every game on the site. Read tools for the list, fields(tool) for a game's settings and text(tool, language) for its labels. For every game except the original four makers, layout(result) returns vector pages in millimetres and toSVG(page) draws one as SVG.

A machine-readable catalog of every game, with its categories, regions and pages in six languages, is at /api/games.json. Plain-text guides for language models are at /llms.txt and /llms-full.txt, and every page links a Markdown version (index.md) from its head.

`tool`: `bingo`, `tombala`, `word-search`, `cards`, `alquerque`, `battleship`, `bulls-and-cows`, `checkers`, `crossword`, `dice-scores`, `dominoes`, `dots-and-boxes`, `exquisite-corpse`, `fortune-teller`, `gomoku`, `goose`, `hangman`, `hex`, `letter-grid`, `loteria`, `ludo`, `mancala`, `maze`, `memory`, `nine-mens-morris`, `nonogram`, `paper-dice`, `paper-soccer`, `raffle-tickets`, `royal-ur`, `scavenger-hunt`, `score-sheets`, `secret-code`, `snakes-and-ladders`, `stop`, `sudoku`, `telephone`, `tic-tac-toe`, `word-scramble`, `xiangqi`

```js
import {generate,layout,toSVG} from 'https://paperoom.yunusemrevurgun.com/assets/api.mjs';
const result=generate({tool:'sudoku',language:'en',seed:'demo',settings:{size:9,difficulty:'easy'}});
const svg=layout(result).map(toSVG); // vector pages, millimetres
```

---
Languages: [English](https://paperoom.yunusemrevurgun.com/developers/index.md) · [Español](https://paperoom.yunusemrevurgun.com/es/developers/index.md) · [العربية](https://paperoom.yunusemrevurgun.com/ar/developers/index.md) · [Português](https://paperoom.yunusemrevurgun.com/pt/developers/index.md) · [中文](https://paperoom.yunusemrevurgun.com/zh/developers/index.md) · [Français](https://paperoom.yunusemrevurgun.com/fr/developers/index.md)
Page: https://paperoom.yunusemrevurgun.com/developers/ · Paperoom by Yunus Emre Vurgun · https://paperoom.yunusemrevurgun.com/llms.txt
