Getting started

Green Patakha is a website where you burst Indian Diwali crackers with real recorded sound. Open /play, pick a cracker, tap the street. There is no account.

Keyboard

1 to 9, 0, -, =, Q, W, EPick one of the 15 crackers
PCycle lights and sound power: 1×, 2×, 4×
SpaceLight the picked cracker at a random spot
MMute or unmute
↑ ↓Volume up or down by 5
AAuto mela on or off
FFull screen

Add ?auto to the URL (/play?auto) to start Auto mela on load, for a TV.

Authentication

None. Every endpoint is public. Reads are cached for a few seconds. Writes to the counter are rate-limited to 30 a minute per address and must come from this site when sent by a browser.

API reference

Base URL: https://diwali.click/api/v1. JSON in, JSON out. Machine-readable spec: openapi.json.

GET /crackers

The 15 crackers with id, names (English and Hindi), kind, loudness, burn time and image.

curl https://diwali.click/api/v1/crackers
{
  "crackers": [
    { "id": "anar", "name": "Anar", "hindi": "अनार", "english": "Flower pot",
      "kind": "ground", "loudness": "Medium", "seconds": 8,
      "about": "A clay cone that throws a fountain…", "image": "/crackers/anar.svg" }
  ]
}

GET /stats

How many crackers everyone has burst, in total and per cracker.

curl https://diwali.click/api/v1/stats
{ "total": 1520, "by_cracker": { "anar": 210, "rocket": 380, … }, "updated_at": "2026-11-08T14:31:09.120Z" }

POST /fires

Add to the counter. The play page batches its taps and sends them every few seconds. Returns the new stats.

curl -X POST https://diwali.click/api/v1/fires \
  -H 'content-type: application/json' \
  -d '{"counts": {"anar": 2, "rocket": 1}}'

Limits: ids from /crackers, each count 1 to 60, at most 240 per request, body under 4 KB.

Errors

Every error has the same shape, with a stable code:

{ "error": { "code": "unknown_cracker", "message": "Unknown cracker \"diya\". See GET /api/v1/crackers." } }
codeHTTPMeaning
invalid_body400The body is not JSON, or it has no counts object.
unknown_cracker400A key in counts is not a cracker id from GET /api/v1/crackers.
invalid_count400A count is not a whole number from 1 to 60.
too_many400More than 240 crackers in one request.
payload_too_large413Body over 4 KB.
forbidden_origin403A browser on another website tried to write the counter.
rate_limited429Over 30 writes a minute from one address. Wait for Retry-After seconds.
not_found404No such route.
method_not_allowed405Wrong HTTP method for this route.
internal500Something broke on our side. It is logged; try again.