{
  "openapi": "3.1.1",
  "info": {
    "title": "Explorer of Everything API",
    "version": "1.0.0",
    "summary": "Deterministic tools for people and AI agents.",
    "description": "Every endpoint performs the same calculation as the human page and returns inputs, result, units, assumptions, sources, warnings and computedAt. MCP endpoint: /mcp."
  },
  "servers": [
    {
      "url": "https://explorer.usefulweb.site"
    }
  ],
  "paths": {
    "/api/v1/tools": {
      "get": {
        "operationId": "listTools",
        "summary": "Catalog of all tools",
        "responses": {
          "200": {
            "description": "Tool list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tools/{id}": {
      "get": {
        "operationId": "getTool",
        "summary": "Definition of one tool",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "explore"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tool definition.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tools/explore/calculate": {
      "post": {
        "operationId": "calculateExplore",
        "summary": "Search transactions, contracts, domains, packages, advisories, MCP servers and websites in one box.",
        "description": "Paste anything technical — a transaction hash, a contract address, a domain, a package like npm:lodash@4.17.20, an advisory ID (GHSA/CVE), an MCP server URL or a web page. The explorer recognises what it is, runs the matching specialised explorer, and gives the entity a permanent page for people and a matching JSON endpoint for software and AI agents. Every answer carries its sources, retrieval time and schema version.\n\nMethodology:\n- Detection rules, in order: 32-byte hex → transaction; 20-byte hex → contract/address; GHSA/CVE/PYSEC/GO/RUSTSEC id → advisory; ecosystem:name@version → package; URL ending in /mcp or /sse (or host mcp.*) → MCP server; other URL → website AI readiness; bare domain → DNS + certificate.\n- The matching explorer runs with its own methodology; its sources, assumptions and warnings are passed through unchanged.\n- Permanent URLs: /explore/{kind}/… for people and /api/v1/… for machines are computed by the same explorer and return the identical result.",
        "tags": [
          "explorer"
        ],
        "x-mcp-tool": "explore",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExploreInput"
              },
              "examples": {
                "example1": {
                  "summary": "A domain",
                  "value": {
                    "query": "example.com"
                  }
                },
                "example2": {
                  "summary": "A package version",
                  "value": {
                    "query": "npm:lodash@4.17.20"
                  }
                },
                "example3": {
                  "summary": "USDC contract on Ethereum",
                  "value": {
                    "query": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
                    "chain": "ethereum"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExploreResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workflows": {
      "get": {
        "operationId": "listWorkflows",
        "summary": "Multi-tool workflows",
        "responses": {
          "200": {
            "description": "Workflow list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Problem": {
        "type": "object",
        "description": "RFC 9457 problem details. 422 responses include per-field `errors`.",
        "required": [
          "type",
          "title",
          "status",
          "detail"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "field",
                "message"
              ],
              "properties": {
                "field": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "ExploreInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "query": {
            "title": "What do you want to explore?",
            "type": "string",
            "maxLength": 2048
          },
          "chain": {
            "title": "Chain (for hashes and addresses)",
            "type": "string",
            "enum": [
              "ethereum",
              "base",
              "arbitrum",
              "optimism",
              "polygon",
              "avalanche",
              "bsc"
            ],
            "default": "ethereum"
          }
        },
        "required": [
          "query"
        ]
      },
      "ExploreResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "query",
              "kind",
              "explorer",
              "label",
              "links",
              "summary",
              "result"
            ],
            "properties": {
              "query": {
                "type": "string"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "transaction",
                  "contract",
                  "domain",
                  "package",
                  "advisory",
                  "mcp-server",
                  "website"
                ]
              },
              "explorer": {
                "type": "string",
                "description": "Tool id that produced the result"
              },
              "label": {
                "type": "string"
              },
              "links": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "human",
                  "api",
                  "explorer"
                ],
                "properties": {
                  "human": {
                    "type": "string"
                  },
                  "api": {
                    "type": "string"
                  },
                  "explorer": {
                    "type": "string"
                  }
                }
              },
              "summary": {
                "type": "string"
              },
              "result": {
                "type": "object",
                "description": "The explorer's own result object (see that tool's schema)."
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    }
  }
}