{
  "openapi": "3.0.3",
  "info": {
    "title": "GTM Tool Finder API",
    "version": "1.0.0",
    "description": "Free, read-only, key-less JSON API over the public OneGTMLab GTM tool directory: API reviews for sales and marketing tools, head-to-head comparisons and plain-English glossary terms. Every record links back to its full page on onegtmlab.dev.",
    "contact": {
      "name": "OneGTMLab",
      "url": "https://www.onegtmlab.dev"
    },
    "license": {
      "name": "MIT",
      "url": "https://opensource.org/licenses/MIT"
    }
  },
  "externalDocs": {
    "description": "OneGTMLab GTM tool directory",
    "url": "https://www.onegtmlab.dev/tool-directory"
  },
  "servers": [
    {
      "url": "https://gtm-tool-finder-api.jaizendra.workers.dev"
    }
  ],
  "paths": {
    "/tools": {
      "get": {
        "summary": "Search the directory",
        "operationId": "searchTools",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Words that must all appear in the name or description."
          },
          {
            "name": "kind",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "tool",
                "category",
                "comparison",
                "glossary"
              ]
            }
          },
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Category slug, for example crm or enrichment."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching entries",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResult"
                }
              }
            }
          }
        }
      }
    },
    "/tools/{id}": {
      "get": {
        "summary": "Get one entry",
        "operationId": "getTool",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "attio"
          }
        ],
        "responses": {
          "200": {
            "description": "The entry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Entry"
                }
              }
            }
          },
          "404": {
            "description": "Unknown id"
          }
        }
      }
    },
    "/categories": {
      "get": {
        "summary": "List the tool categories",
        "operationId": "listCategories",
        "responses": {
          "200": {
            "description": "Categories with tool counts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Category"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Entry": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "tool",
              "category",
              "comparison",
              "glossary"
            ]
          },
          "category": {
            "type": "string",
            "nullable": true
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "description": {
            "type": "string"
          }
        }
      },
      "Category": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "description": {
            "type": "string"
          },
          "tool_count": {
            "type": "integer"
          }
        }
      },
      "SearchResult": {
        "type": "object",
        "properties": {
          "total": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Entry"
            }
          }
        }
      }
    }
  }
}