{
  "openapi": "3.1.0",
  "info": {
    "title": "Trakis agent API",
    "version": "1.0.0",
    "summary": "Free, unauthenticated endpoints for AI agents: an instant SEO check of any public site, and the explanation of every check.",
    "description": "Trakis is an SEO audit tool that counts each problem once, with the pages it covers. Without an account, an agent can run a free instant check of any public site (the first 25 pages, graded out of 100, each problem counted once, and which AI assistants' bots its robots.txt keeps out) and read how to fix each of the 100+ checks. The same tools are on the MCP server at https://trakis.io/mcp. Every answer is Markdown inside JSON, written to be read to a person. See https://trakis.io/auth.md for what needs an account.",
    "termsOfService": "https://trakis.io/terms",
    "contact": {
      "email": "hello@trakis.io",
      "url": "https://trakis.io"
    }
  },
  "servers": [
    {
      "url": "https://trakis.io"
    }
  ],
  "externalDocs": {
    "description": "How an agent uses Trakis",
    "url": "https://trakis.io/connect#agents"
  },
  "paths": {
    "/api/agent/site-checks": {
      "post": {
        "operationId": "startSiteCheck",
        "summary": "Start an instant SEO check of a public site",
        "description": "Reads the first 25 pages, grades them out of 100 and counts each problem once. Takes about a minute; read the result with the returned check_id. A site checked in the last day gets that check back.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "examples": [
                      "example.com"
                    ]
                  }
                },
                "required": [
                  "url"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Started, or an earlier check of the site returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckStarted"
                }
              }
            }
          },
          "400": {
            "description": "The input is not usable; the text says why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Answer"
                }
              }
            }
          },
          "404": {
            "description": "Nothing by that id or code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Answer"
                }
              }
            }
          },
          "429": {
            "description": "This network has had its instant checks for now, or the site has had its checks for today.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Answer"
                }
              }
            }
          }
        }
      }
    },
    "/api/agent/site-checks/{id}": {
      "get": {
        "operationId": "getSiteCheck",
        "summary": "Read an instant check",
        "description": "The grade, the problems by severity with the pages each covers and a link to its fix, and the AI bots robots.txt blocks. While the check runs, waits up to 20 seconds, then says to ask again.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The check, or that it is still running.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Answer"
                }
              }
            }
          },
          "400": {
            "description": "The input is not usable; the text says why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Answer"
                }
              }
            }
          },
          "404": {
            "description": "Nothing by that id or code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Answer"
                }
              }
            }
          },
          "429": {
            "description": "This network has had its instant checks for now, or the site has had its checks for today.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Answer"
                }
              }
            }
          }
        }
      }
    },
    "/api/agent/checks": {
      "get": {
        "operationId": "findChecks",
        "summary": "Find checks by words, or list them",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Words, e.g. \"canonical\" or \"duplicate title\". Without it, the checks are listed."
          },
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "severity",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "critical",
                "warning",
                "notice"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The checks found, best first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Answer"
                }
              }
            }
          }
        }
      }
    },
    "/api/agent/checks/{code}": {
      "get": {
        "operationId": "explainCheck",
        "summary": "Explain one check",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "examples": [
                "CRAWL-008"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "What it looks at, why it matters, how to fix and verify it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Answer"
                }
              }
            }
          },
          "404": {
            "description": "No check by that code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Answer"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Answer": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "description": "The answer, as Markdown."
          }
        },
        "required": [
          "text"
        ]
      },
      "CheckStarted": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "description": "What happened, as Markdown."
          },
          "check_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Pass it to GET /api/agent/site-checks/{id}."
          }
        },
        "required": [
          "text",
          "check_id"
        ]
      }
    }
  }
}