Skip to content

Instantly share code, notes, and snippets.

@misaelvillaverde
Last active February 12, 2026 17:39
Show Gist options
  • Select an option

  • Save misaelvillaverde/db673b525a1216abf9bc4e555cd2e98b to your computer and use it in GitHub Desktop.

Select an option

Save misaelvillaverde/db673b525a1216abf9bc4e555cd2e98b to your computer and use it in GitHub Desktop.
Pixel Canvas - Fase 3: Endpoints Avanzados

Pixel Canvas - Fase 3: Endpoints Avanzados

Estos endpoints se habilitan cuando el instructor activa la Fase 3. Requieren autenticacion (Authorization: Bearer TU-API-KEY).

Base URL: https://pixels.misael.software


GET /api/threats

Sobreescrituras recientes de tus pixeles en los ultimos 5 minutos. Util para saber quien esta atacando tu territorio.

curl -H "Authorization: Bearer PXL-XXXX-XXXX" \
  https://pixels.misael.software/api/threats
{
  "threats": [
    {
      "x": 64,
      "y": 64,
      "old_color": "#FF0000",
      "new_color": "#0000FF",
      "overwritten_by": "jugador2",
      "timestamp": "2026-02-12T18:40:00.000Z"
    },
    {
      "x": 65,
      "y": 64,
      "old_color": "#FF0000",
      "new_color": "#00FF00",
      "overwritten_by": "jugador3",
      "timestamp": "2026-02-12T18:39:55.000Z"
    }
  ]
}

POST /api/pixel/batch

Coloca hasta 5 pixeles en una sola llamada. Cada pixel consume un cooldown individual de 10 segundos.

curl -X POST https://pixels.misael.software/api/pixel/batch \
  -H "Authorization: Bearer PXL-XXXX-XXXX" \
  -H "Content-Type: application/json" \
  -d '{
    "pixels": [
      { "x": 10, "y": 10, "color": "red" },
      { "x": 11, "y": 10, "color": "red" },
      { "x": 12, "y": 10, "color": "red" }
    ]
  }'
{
  "placed": [
    { "x": 10, "y": 10, "color": "#FF0000" },
    { "x": 11, "y": 10, "color": "#FF0000" }
  ],
  "rejected": [
    { "x": 12, "y": 10, "color": "red", "reason": "Rate limited (8s)" }
  ],
  "next_available_at": "2026-02-12T18:40:20.000Z"
}

Si la fase 3 no esta activa:

{
  "error": "This endpoint is not available yet",
  "phase_required": 3
}

Tools MCP a implementar

Tool Descripcion
get_threats Llama GET /api/threats
batch_place Llama POST /api/pixel/batch con array de pixeles (max 5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment