{
  "openapi": "3.1.0",
  "info": {
    "title": "UpGrow public API",
    "version": "1.0.0",
    "summary": "Read-only facts about UpGrow plans, the one-time shop, free Instagram tools and the blog.",
    "description": "A free, read-only JSON API for AI agents and developers. No authentication, no API key. Plan prices are first-month prices and shop prices are one-time prices. Documentation: https://www.upgrow.com/developers",
    "contact": {
      "name": "UpGrow Team",
      "url": "https://www.upgrow.com/contact"
    }
  },
  "servers": [
    {
      "url": "https://www.upgrow.com",
      "description": "Production"
    }
  ],
  "externalDocs": {
    "description": "UpGrow for AI agents and developers",
    "url": "https://www.upgrow.com/developers"
  },
  "paths": {
    "/api/public/v1/plans": {
      "get": {
        "operationId": "listPlans",
        "summary": "List the UpGrow growth plans",
        "description": "Basic, Pro and Turbo with the first-month price, what each plan includes and the sign-up link.",
        "responses": {
          "200": {
            "description": "The growth plans",
            "headers": {
              "Access-Control-Allow-Origin": {
                "schema": {
                  "type": "string"
                },
                "description": "Always *"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlansResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/products": {
      "get": {
        "operationId": "listProducts",
        "summary": "List the one-time shop products",
        "description": "Instagram and TikTok followers, likes, views and comments sold once, with tiers, starting prices and product page links.",
        "responses": {
          "200": {
            "description": "The shop products",
            "headers": {
              "Access-Control-Allow-Origin": {
                "schema": {
                  "type": "string"
                },
                "description": "Always *"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductsResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/free-tools": {
      "get": {
        "operationId": "listFreeTools",
        "summary": "List the free Instagram tools",
        "description": "Each free tool with its page link and a one-line description.",
        "responses": {
          "200": {
            "description": "The free tools",
            "headers": {
              "Access-Control-Allow-Origin": {
                "schema": {
                  "type": "string"
                },
                "description": "Always *"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeToolsResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/blog/search": {
      "get": {
        "operationId": "searchBlog",
        "summary": "Search the UpGrow blog",
        "description": "Blog posts matching the query, most relevant first.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Search text, 2 to 100 characters.",
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 100
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results, 1 to 10. Defaults to 5.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10,
              "default": 5
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching posts",
            "headers": {
              "Access-Control-Allow-Origin": {
                "schema": {
                  "type": "string"
                },
                "description": "Always *"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlogSearchResponse"
                }
              }
            }
          },
          "400": {
            "description": "q or limit is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "The search backend failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "Health check",
        "description": "Returns {\"status\":\"ok\"}. Never cached.",
        "responses": {
          "200": {
            "description": "The API is up",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "ok"
                    }
                  },
                  "required": [
                    "status"
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          }
        },
        "required": [
          "error"
        ]
      },
      "Plan": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "examples": [
              "Basic"
            ]
          },
          "firstMonthPrice": {
            "type": "string",
            "description": "First-month price in US dollars.",
            "examples": [
              "$49"
            ]
          },
          "currency": {
            "type": "string",
            "const": "USD"
          },
          "description": {
            "type": "string"
          },
          "includes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "pricingUrl": {
            "type": "string",
            "format": "uri"
          },
          "signupUrl": {
            "type": "string",
            "format": "uri"
          }
        },
        "required": [
          "name",
          "firstMonthPrice",
          "currency",
          "description",
          "includes",
          "pricingUrl",
          "signupUrl"
        ]
      },
      "PlansResponse": {
        "type": "object",
        "properties": {
          "plans": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Plan"
            }
          }
        },
        "required": [
          "plans"
        ]
      },
      "ProductTier": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "features": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "from": {
            "type": "string",
            "description": "Smallest package of this tier with its one-time price.",
            "examples": [
              "100 followers for $2.99"
            ]
          }
        },
        "required": [
          "name",
          "features",
          "from"
        ]
      },
      "Product": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "platform": {
            "type": "string",
            "enum": [
              "instagram",
              "tiktok"
            ]
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "from": {
            "type": "string",
            "description": "Smallest package with its one-time price.",
            "examples": [
              "50 likes for $1.99"
            ]
          },
          "delivery": {
            "type": "string"
          },
          "guarantees": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "tiers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductTier"
            }
          }
        },
        "required": [
          "slug",
          "name",
          "platform",
          "url",
          "from",
          "delivery",
          "guarantees",
          "tiers"
        ]
      },
      "ProductsResponse": {
        "type": "object",
        "properties": {
          "products": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Product"
            }
          }
        },
        "required": [
          "products"
        ]
      },
      "FreeTool": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "description": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "url",
          "description"
        ]
      },
      "FreeToolsResponse": {
        "type": "object",
        "properties": {
          "tools": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FreeTool"
            }
          }
        },
        "required": [
          "tools"
        ]
      },
      "BlogPost": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "publishedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "title",
          "url",
          "description",
          "publishedAt"
        ]
      },
      "BlogSearchResponse": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string"
          },
          "count": {
            "type": "integer"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BlogPost"
            }
          }
        },
        "required": [
          "query",
          "count",
          "results"
        ]
      }
    }
  }
}
