# Chess daily or random puzzle API

Get daily chess puzzles or the supported Chess.com random option via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Apish, pass parameters such as output, raw, site, and retrieve structured data including source board-position FEN and source puzzle PGN text for chess reference, and record navigation, ready for production pipelines and AI agent automation.

Documentation: https://openany.si/chess/chess-daily-or-random-puzzle-api/8505de99-3ddd-4278-9923-e3b6e7b038fd/
API ID: 8505de99-3ddd-4278-9923-e3b6e7b038fd
Provider: apish
Contract revision: 3
Method: GET
Endpoint: https://api.openany.si/v1/agent-apis/apish/chess/v1/puzzle
Page update time: 2026-12-03T02:47:48.001Z
Access: OpenAny REST
OpenAny MCP: availability is not supplied by this REST contract. Check get_api on the configured OpenAny MCP server before execution.
Request content type: none
Execution mode: sync
Authentication: Authorization: Bearer $OPENANY_API_KEY

## Billing
Price: $0.002 / billing credit
API-key calls use your shared balance. Review the published billing rules before making a paid request.
Price source: OpenAny public API contract.
Contract update time: 2026-12-03T02:47:46.942Z. This is not a price-change timestamp.
```json
{
  "currency": "USD",
  "mode": "rules",
  "parameters": [],
  "policy_version": 2,
  "sale": {
    "addons": [],
    "base_price_micro_usd": "0",
    "max_cost_micro_usd": "2000",
    "quantities": [
      {
        "id": "upstream_credits",
        "label": "Actual API.SH credits consumed",
        "max_quantity": "1",
        "measure": "value",
        "pointer": "/credits_used",
        "price_micro_usd": "2000",
        "quantity_scale": 0,
        "source": "response",
        "unit": "credit",
        "unit_quantity": "1"
      }
    ],
    "rounding": "ceil",
    "variants": []
  }
}
```

## Usage and limits
## Chess.com & Lichess Puzzles API

Use site and type, defaulting to chesscom and daily. random is documented only for Chess.com; keep FEN position, PGN text and solution values in their returned source forms.

## What You Can Build

- **Chess reference**: Keep source site and entity identity.
- **Record navigation**: Preserve the site-specific category and time-control scope.

## Returned Data

| Field | Meaning |
| --- | --- |
| `fen` | Source board-position FEN |
| `pgn` | Source puzzle PGN text |
| `solution` | Source puzzle solution when present |
| `published` | Source publication timestamp when present |

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Chess daily or random puzzle API request inputs",
  "$comment": "Declared input types grouped by HTTP location. Path, query and header values describe decoded inputs and are serialized as text on the wire; body is the payload. This is not an exhaustive provider contract or a schema for the raw HTTP request.",
  "type": "object",
  "properties": {
    "path": {
      "type": "object",
      "properties": {}
    },
    "query": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "daily (default) or random (chess.com only).",
          "enum": [
            "daily",
            "random"
          ]
        },
        "site": {
          "type": "string",
          "description": "chesscom (default) or lichess.",
          "enum": [
            "chesscom",
            "lichess"
          ]
        },
        "raw": {
          "type": "string",
          "description": "0 leaves out the bulky `raw` source blocks (often 10-30x smaller).",
          "enum": [
            "0",
            "1"
          ]
        },
        "fields": {
          "type": "string",
          "description": "Comma-separated fields to return, e.g. `posts.id,posts.title`. Call metadata is always included."
        },
        "fresh": {
          "type": "string",
          "description": "1 skips the 24-hour cache and fetches live.",
          "enum": [
            "1"
          ]
        },
        "output": {
          "type": "string",
          "description": "JSON only for this OpenAny product. Omit output or use json; CSV and NDJSON are not supported.",
          "enum": [
            "json"
          ]
        },
        "records": {
          "type": "string",
          "description": "With output=csv|ndjson: the top-level list to turn into rows (e.g. `reviews`), or `.` for the whole object as one row."
        }
      }
    },
    "headers": {
      "type": "object",
      "properties": {}
    }
  },
  "required": [
    "path",
    "query",
    "headers"
  ]
}
```

## Response fields
Source: Inferred from examples; not an exhaustive provider schema.
```json
{
  "type": "object",
  "properties": {
    "cached": {
      "type": "boolean"
    },
    "credits_used": {
      "type": "integer"
    },
    "fen": {
      "type": "string"
    },
    "fetched_at": {
      "type": "string"
    },
    "image": {
      "type": "string"
    },
    "pgn": {
      "type": "string"
    },
    "published": {
      "type": "string"
    },
    "site": {
      "type": "string"
    },
    "solution": {
      "type": "string"
    },
    "title": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "url": {
      "type": "string"
    }
  }
}
```

## Request example
Scenario: Official example · Live API.SH response · Minimal request
```bash
curl \
  'https://api.openany.si/v1/agent-apis/apish/chess/v1/puzzle?output=json&raw=0&site=chesscom&type=daily' \
  -X GET \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json'
```

## Response example
Example from the provider's documentation. Field values in your results will differ.
Sample response · Documented HTTP 200
```json
{
  "cached": false,
  "credits_used": 1,
  "fen": "4r1k1/1pp1qp1p/p5p1/8/P1PP4/Nn1B4/1P3PPQ/3R1K1R b - - 0 20",
  "fetched_at": "2026-11-19T12:20:23.363Z",
  "image": "https://www.chess.com/dynboard?fen=4r1k1/1pp1qp1p/p5p1/8/P1PP4/Nn1B4/1P3PPQ/3R1K1R%20b%20-%20-%200%2020&size=2",
  "pgn": "[White \"Daily Puzzle Inspiration\"]\n[Black \"KingsBishop\"]\n[Result \"0-1\"]\n[FEN \"4r1k1/1pp1qp1p/p5p1/8/P1PP4/Nn1B4/1P3PPQ/3R1K1R b - - 0 20\"]\n\n20... Qe1+ 21. Rxe1 Nd2+ 22. Kg1 Rxe1+ 23. Bf1 Rxf1# 0-1",
  "published": "2026-11-19T08:00:00.000Z",
  "site": "chesscom",
  "solution": "20... Qe1+ 21. Rxe1 Nd2+ 22. Kg1 Rxe1+ 23. Bf1 Rxf1# 0-1",
  "title": "Decoy, Deflection, Oh My!",
  "type": "daily",
  "url": "https://www.chess.com/daily/2026-11-19"
}
```

## Error handling
400: Check the request fields.
401 / 403: Verify credentials and access permissions.
402: Inspect payment requirements and balance.
429: Respect returned retry guidance.
5xx: Inspect the error and usage record before retrying a paid operation.

## Common questions
### Can I request random on both sites?
No. The documented random option is Chess.com only; daily is the default.

### Does FEN contain the whole game history?
It describes the board state. Preserve it separately from PGN and solution text.

### Is published the retrieval timestamp?
No. Keep source publication time distinct from fetched_at.

### Does this endpoint submit moves or run analysis?
It reads source puzzle records and solutions; it does not play moves or generate engine analysis.

### How do I bypass cached results?
Pass fresh=1. A cache bypass retrieves available source data; it does not make unpublished or restricted records available.

### Can I request CSV or NDJSON?
This OpenAny implementation serves JSON only. Omit output or set output=json.

## Available implementations
- apish: https://openany.si/chess/chess-daily-or-random-puzzle-api/8505de99-3ddd-4278-9923-e3b6e7b038fd/

Integration guide: https://openany.si/docs/
Agent setup: https://openany.si/SKILL.md
