{
  "openapi": "3.1.0",
  "info": {
    "title": "Oakferry Agents API",
    "version": "1.0.0",
    "description": "Apps from Oakferry Games Inc., described for AI agents: dated, sourced facts, comparison tables, a search API and an MCP server. Read-only, no key needed. Facts carry dates and sources."
  },
  "servers": [
    {
      "url": "https://agents.oakferry.com"
    }
  ],
  "paths": {
    "/api/v1/search": {
      "get": {
        "operationId": "searchProducts",
        "summary": "Find products that match a person's constraints",
        "description": "Hard filters (platform, maxPrice, free, noSubscription, attr.*) exclude; q only ranks. Each hit says why it matched.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Free text, e.g. 'spelling practice for kids'"
          },
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "platform",
            "in": "query",
            "schema": {
              "type": "string",
              "examples": [
                "iOS",
                "Android",
                "Web"
              ]
            }
          },
          {
            "name": "maxPrice",
            "in": "query",
            "schema": {
              "type": "number"
            },
            "description": "Most the cheapest way in may cost; 0 = free to start"
          },
          {
            "name": "free",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "description": "Only products with a free offer"
          },
          {
            "name": "noSubscription",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "description": "Only products usable without a subscription"
          },
          {
            "name": "attr.{key}",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Exact attribute match, e.g. attr.offline=true; comma-separate for lists. Keys: /api/v1/attributes"
          },
          {
            "name": "org",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matches, best first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "results": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Hit"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/products": {
      "get": {
        "operationId": "listProducts",
        "summary": "Every product, full records",
        "responses": {
          "200": {
            "description": "All products",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "products": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Product"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/products/{id}": {
      "get": {
        "operationId": "getProduct",
        "summary": "One product: platforms, offers, ratings, attributes, limits, sources",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The product",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Product"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/comparisons": {
      "get": {
        "operationId": "listComparisons",
        "summary": "Comparison tables, including competitors",
        "responses": {
          "200": {
            "description": "All comparisons"
          }
        }
      }
    },
    "/api/v1/comparisons/{id}": {
      "get": {
        "operationId": "getComparison",
        "summary": "One comparison table",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The comparison"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/attributes": {
      "get": {
        "operationId": "listAttributes",
        "summary": "Filterable attribute keys and the values products use",
        "responses": {
          "200": {
            "description": "Attribute keys with values"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          }
        },
        "required": [
          "error"
        ]
      },
      "Hit": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "maker": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "platforms": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "os": {
                  "type": "string"
                },
                "store": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                }
              }
            }
          },
          "priceLabel": {
            "type": "string"
          },
          "overallRating": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "value": {
                "type": "number"
              },
              "count": {
                "type": "integer"
              }
            }
          },
          "matched": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Why this matched"
          },
          "score": {
            "type": "number"
          },
          "detail": {
            "type": "string",
            "description": "URL of the full record"
          }
        }
      },
      "Product": {
        "type": "object",
        "description": "Full record. See the catalog types for every field.",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "platforms": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "offers": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "rating": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "features": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "useCases": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "notFor": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "When not to recommend it"
          },
          "attributes": {
            "type": "object",
            "additionalProperties": true
          },
          "mentions": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Third-party coverage"
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "updated": {
            "type": "string",
            "description": "Date the listing was last checked"
          },
          "url": {
            "type": "string"
          },
          "markdownUrl": {
            "type": "string"
          },
          "priceLabel": {
            "type": "string"
          }
        }
      }
    }
  }
}
