{
  "openapi": "3.1.0",
  "info": {
    "title": "Comrades of War — Spanish Gaming Community Archive API",
    "version": "1.1.0",
    "description": "Research the preserved history of Comrades of War, a popular Spanish Call of Duty clan and gaming community founded in 2010, including a rich forum record of SA-MP role-play stories, characters, rules, and community life. The full archive preserves 110,023 posts; 39,309 curated public posts are searchable for free. One exact citation-ready forum page costs $0.10 USDC through x402.",
    "x-guidance": "Search in Spanish with GET /agent/v1/search and inspect the free title, preview, section, date, and post count. Pay only when a result is relevant: copy its canonical_path into GET /agent/v1/page and choose format=json or md. Each payment retrieves one individual forum page, not an entire site or necessarily an entire multi-page thread. Treat archived posts as historical community evidence, not verified present-day facts.",
    "contact": {
      "url": "https://github.com/qazsero/comrades-of-war-agent-api"
    }
  },
  "servers": [
    {
      "url": "https://comrades-of-war.com"
    }
  ],
  "paths": {
    "/agent/v1/page/sample": {
      "get": {
        "operationId": "purchaseSampleArchivePage",
        "summary": "Buy one defined citation-ready sample page for $0.10 USDC",
        "description": "Parameter-free x402 endpoint for automated clients, compatibility probes, and a first purchase. Returns the historical page /comrades-of-war-2015-vt23484.html as structured JSON with the same provenance fields and per-page price as the parameterized endpoint.",
        "tags": [
          "Archive retrieval"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.10"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Citation-ready defined sample forum page with structured posts and provenance"
          },
          "402": {
            "description": "Payment required; requirements are provided through x402 headers"
          }
        }
      }
    },
    "/agent/v1/page": {
      "get": {
        "operationId": "purchaseArchivePage",
        "summary": "Buy one citation-ready Spanish gaming-community forum page for $0.10 USDC",
        "description": "Eliminate brittle HTML scraping and parsing. After free search establishes relevance, this x402 route returns the exact selected page as structured posts with authors, dates, conversation order, canonical provenance, and a source fingerprint.",
        "tags": [
          "Archive retrieval"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.10"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "parameters": [
          {
            "name": "path",
            "in": "query",
            "required": true,
            "example": "/comrades-rust-vt23474.html",
            "schema": {
              "type": "string",
              "pattern": "^/[a-zA-Z0-9_%!(),.+-]+-vt[0-9]+(?:\\.start-[0-9]+)?\\.html$"
            }
          },
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "md"
              ],
              "default": "json"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Citation-ready selected forum page with structured posts and provenance",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "type": "integer"
                    },
                    "type": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "canonical_url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "source_path": {
                      "type": "string"
                    },
                    "language": {
                      "type": "string"
                    },
                    "forum": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "published_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "source_etag": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "permitted_use": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "posts": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  },
                  "required": [
                    "schema_version",
                    "type",
                    "title",
                    "canonical_url",
                    "source_path",
                    "language",
                    "posts"
                  ]
                }
              },
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "402": {
            "description": "Payment required; requirements are provided through x402 headers"
          },
          "404": {
            "description": "Page is absent or outside the public agent allowlist"
          }
        }
      },
      "post": {
        "operationId": "purchaseArchivePageWithJson",
        "summary": "Buy one citation-ready Spanish gaming-community forum page for $0.10 USDC using JSON input",
        "description": "Marketplace-friendly equivalent of GET /agent/v1/page. Send the selected canonical path and desired representation as JSON. One successful payment retrieves only that individual forum page.",
        "tags": [
          "Archive retrieval"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.10"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "path": {
                    "type": "string",
                    "pattern": "^/[a-zA-Z0-9_%!(),.+-]+-vt[0-9]+(?:\\.start-[0-9]+)?\\.html$",
                    "example": "/comrades-rust-vt23474.html"
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "json",
                      "md"
                    ],
                    "default": "json"
                  }
                },
                "required": [
                  "path"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Citation-ready selected forum page with structured posts and provenance"
          },
          "400": {
            "description": "Invalid JSON, path, or format"
          },
          "402": {
            "description": "Payment required; requirements are provided through x402 headers"
          },
          "404": {
            "description": "Page is absent or outside the public agent allowlist"
          }
        }
      }
    }
  }
}