{
 "openapi": "3.1.0",
 "info": {
  "title": "AdStack Watch API",
  "version": "1.0.0",
  "description": "Read-only static JSON API: ad & martech platform changes (sunsets, deprecations, breaking, policy, tracking/signal-loss, format) and GTM tool pricing history. Every record links an official source_url and carries fetched_at. Filtering is client-side (files are static); the MCP server offers server-side search.",
  "license": {
   "name": "CC BY 4.0 (compilation); source text under its owners' terms",
   "url": "https://creativecommons.org/licenses/by/4.0/"
  },
  "x-generated": "2026-10-17T03:44:51Z"
 },
 "servers": [
  {
   "url": "https://adstackwatch.com"
  }
 ],
 "paths": {
  "/api/index.json": {
   "get": {
    "operationId": "getIndex",
    "summary": "List of endpoints",
    "responses": {
     "200": {
      "description": "Endpoint index",
      "content": {
       "application/json": {}
      }
     }
    }
   }
  },
  "/api/changes.json": {
   "get": {
    "operationId": "listChanges",
    "summary": "All change records",
    "responses": {
     "200": {
      "description": "Changes",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ChangeList"
        }
       }
      }
     }
    }
   }
  },
  "/api/upcoming.json": {
   "get": {
    "operationId": "listUpcoming",
    "summary": "Changes with an effective date on/after build date, soonest first",
    "responses": {
     "200": {
      "description": "Upcoming",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ChangeList"
        }
       }
      }
     }
    }
   }
  },
  "/api/platforms.json": {
   "get": {
    "operationId": "listPlatforms",
    "summary": "Platforms and categories with counts",
    "responses": {
     "200": {
      "description": "Platforms",
      "content": {
       "application/json": {}
      }
     }
    }
   }
  },
  "/api/changes/{platform}.json": {
   "get": {
    "operationId": "listChangesByPlatform",
    "summary": "Changes for one platform",
    "parameters": [
     {
      "name": "platform",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "google-ads",
        "meta",
        "linkedin",
        "tiktok",
        "shopify",
        "hubspot",
        "salesforce"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Changes",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ChangeList"
        }
       }
      }
     }
    }
   }
  },
  "/api/change/{id}.json": {
   "get": {
    "operationId": "getChange",
    "summary": "One change by stable id",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Change",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Change"
        }
       }
      }
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/api/prices.json": {
   "get": {
    "operationId": "listToolPrices",
    "summary": "Latest pricing snapshot for every tracked GTM tool",
    "responses": {
     "200": {
      "description": "Tools",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "tools": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Tool"
           }
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/prices/{tool_id}.json": {
   "get": {
    "operationId": "getToolPricing",
    "summary": "Latest pricing + history for one tool",
    "parameters": [
     {
      "name": "tool_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "apollo",
        "clay",
        "zoominfo",
        "hubspot-sales-hub",
        "hubspot-marketing-hub",
        "instantly",
        "smartlead",
        "lemlist",
        "artisan",
        "aisdr",
        "salesforce-sales-cloud",
        "salesforce-agentforce"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Tool",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "tool": {
           "$ref": "#/components/schemas/Tool"
          },
          "history": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/PriceEvent"
           }
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/price-history.json": {
   "get": {
    "operationId": "listPriceHistory",
    "summary": "All price-history events",
    "responses": {
     "200": {
      "description": "Events",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "events": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/PriceEvent"
           }
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/sources.json": {
   "get": {
    "operationId": "getSourceStatus",
    "summary": "Collector status per source (ok/failed/skipped, counts)",
    "responses": {
     "200": {
      "description": "Status",
      "content": {
       "application/json": {}
      }
     }
    }
   }
  },
  "/api/newsletter/latest.json": {
   "get": {
    "operationId": "getLatestDigest",
    "summary": "Latest weekly digest content",
    "responses": {
     "200": {
      "description": "Digest",
      "content": {
       "application/json": {}
      }
     }
    }
   }
  }
 },
 "components": {
  "schemas": {
   "Change": {
    "type": "object",
    "required": [
     "id",
     "platform",
     "title",
     "source_url",
     "fetched_at"
    ],
    "properties": {
     "id": {
      "type": "string",
      "description": "Stable ID: <platform>-<sha1(source key)[:10]>"
     },
     "platform": {
      "type": "string"
     },
     "title": {
      "type": "string"
     },
     "summary": {
      "type": "string",
      "description": "Extractive summary of fetched official text"
     },
     "categories": {
      "type": "array",
      "items": {
       "type": "string",
       "enum": [
        "api_version_sunset",
        "deprecation",
        "breaking_change",
        "tracking_signal",
        "policy",
        "format_change",
        "announcement"
       ]
      }
     },
     "tags": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "published_date": {
      "type": [
       "string",
       "null"
      ],
      "description": "YYYY-MM-DD or YYYY-MM"
     },
     "effective_date": {
      "type": [
       "string",
       "null"
      ],
      "description": "Deadline / sunset; YYYY-MM-DD or YYYY-MM"
     },
     "effective_date_precision": {
      "type": [
       "string",
       "null"
      ],
      "enum": [
       "day",
       "month",
       null
      ]
     },
     "upcoming": {
      "type": "boolean"
     },
     "source_url": {
      "type": "string",
      "format": "uri",
      "pattern": "^https://"
     },
     "source_name": {
      "type": "string"
     },
     "fetched_at": {
      "type": "string",
      "format": "date-time"
     },
     "first_seen": {
      "type": "string"
     },
     "collector": {
      "type": "string"
     },
     "url": {
      "type": "string"
     },
     "tentative": {
      "type": "boolean",
      "description": "Unreleased version whose date the platform lists as tentative (e.g. planned Google Ads API versions)."
     },
     "optional_release": {
      "type": "boolean"
     },
     "source_label": {
      "type": "string",
      "description": "Status label shown by the source, e.g. 'To be deprecated'."
     },
     "in_source": {
      "type": "boolean",
      "description": "False when the record is no longer listed by its source (kept so IDs and URLs stay stable)."
     },
     "last_seen_in_source": {
      "type": "string",
      "format": "date-time"
     },
     "changed_at": {
      "type": "string",
      "format": "date-time",
      "description": "When the title or effective date last changed."
     }
    }
   },
   "ChangeList": {
    "type": "object",
    "properties": {
     "count": {
      "type": "integer"
     },
     "generated_at": {
      "type": "string"
     },
     "changes": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Change"
      }
     }
    }
   },
   "Plan": {
    "type": "object",
    "properties": {
     "label": {
      "type": "string"
     },
     "kind": {
      "type": "string",
      "enum": [
       "plan",
       "addon"
      ]
     },
     "price_text": {
      "type": "string"
     },
     "price": {
      "type": [
       "number",
       "null"
      ]
     },
     "alt_price_text": {
      "type": [
       "string",
       "null"
      ],
      "description": "Second price shown for the plan (e.g. list vs promo, or the Yearly toggle)."
     },
     "unit_text": {
      "type": [
       "string",
       "null"
      ]
     },
     "allowance_text": {
      "type": [
       "string",
       "null"
      ]
     },
     "excerpt": {
      "type": "string"
     },
     "billing": {
      "type": [
       "string",
       "null"
      ],
      "enum": [
       "annual",
       "monthly",
       "quarterly",
       null
      ],
      "description": "Billing period stated next to the price on the page, if any."
     },
     "alt_price_note": {
      "type": [
       "string",
       "null"
      ]
     }
    }
   },
   "Tool": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string"
     },
     "name": {
      "type": "string"
     },
     "category": {
      "type": "string"
     },
     "pricing_url": {
      "type": "string"
     },
     "last_snapshot": {
      "type": "string"
     },
     "fetched_at": {
      "type": "string"
     },
     "public_pricing": {
      "type": "boolean"
     },
     "plans": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Plan"
      }
     },
     "notes": {
      "type": "array",
      "items": {
       "type": "string"
      }
     }
    }
   },
   "PriceEvent": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string"
     },
     "tool_id": {
      "type": "string"
     },
     "plan": {
      "type": "string"
     },
     "event": {
      "type": "string",
      "enum": [
       "first_seen",
       "price_change",
       "allowance_change",
       "page_changed"
      ]
     },
     "date": {
      "type": "string"
     },
     "old_price_text": {
      "type": "string"
     },
     "price_text": {
      "type": "string"
     },
     "source_url": {
      "type": "string"
     },
     "snapshot_source": {
      "type": "string"
     }
    }
   }
  }
 }
}