{
  "openapi": "3.1.0",
  "info": {
    "title": "automaatic API",
    "version": "1.1.0",
    "description": "GET-only, text/plain responses of ranked US clinic organization records. Live verticals: pt-clinics and chiropractors. A request without k returns a three-result preview without login; a free session at https://automaatic.tech/start provides a key and a session link with ready-made authenticated links."
  },
  "servers": [
    {
      "url": "https://api.automaatic.tech"
    }
  ],
  "paths": {
    "/v1/find/{vertical}": {
      "get": {
        "summary": "Ranked organizations nationwide",
        "operationId": "findOrganizationsNationally",
        "parameters": [
          {
            "$ref": "#/components/parameters/Vertical"
          },
          {
            "$ref": "#/components/parameters/ApiKey"
          }
        ],
        "responses": {
          "200": {
            "description": "A three-result no-login preview, or the top 25 scored results with pagination links when k is valid.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/find/{vertical}/{state}": {
      "get": {
        "summary": "Ranked organizations in a US state",
        "operationId": "findOrganizationsByState",
        "parameters": [
          {
            "$ref": "#/components/parameters/Vertical"
          },
          {
            "name": "state",
            "in": "path",
            "required": true,
            "description": "Two-letter US state code or lowercase state slug.",
            "schema": {
              "type": "string",
              "examples": ["TX", "new-york"]
            }
          },
          {
            "$ref": "#/components/parameters/ApiKey"
          }
        ],
        "responses": {
          "200": {
            "description": "A three-result no-login preview, or the top 25 scored results with pagination and full-report links when k is valid.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/report/{vertical}/{state}": {
      "get": {
        "summary": "Request a full state report (requires a key)",
        "operationId": "requestFullReport",
        "parameters": [
          {
            "$ref": "#/components/parameters/Vertical"
          },
          {
            "name": "state",
            "in": "path",
            "required": true,
            "description": "Two-letter US state code or lowercase state slug.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/ApiKey"
          }
        ],
        "responses": {
          "200": {
            "description": "A link to the hosted full report listing every matching organization in the state. Free tier: 3 full reports per calendar month; a repeated request for the same report returns the existing link without consuming quota.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/s/{token}": {
      "get": {
        "summary": "Session link with ready-made authenticated links",
        "operationId": "fetchSession",
        "servers": [
          {
            "url": "https://automaatic.tech"
          }
        ],
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "description": "Session token issued at https://automaatic.tech/start.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Optional plain-language description of what the user sells; the matching vertical is listed first.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "text/plain list of complete authenticated links per vertical and state. Follow these links; do not construct URLs.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "Vertical": {
        "name": "vertical",
        "in": "path",
        "required": true,
        "description": "Published API vertical.",
        "schema": {
          "type": "string",
          "enum": ["pt-clinics", "chiropractors"]
        }
      },
      "ApiKey": {
        "name": "k",
        "in": "query",
        "required": false,
        "description": "Optional automaatic API key from the free session flow at https://automaatic.tech/start. Omit it for the no-login three-result preview.",
        "schema": {
          "type": "string"
        }
      }
    }
  }
}
