{
  "openapi": "3.1.0",
  "info": {
    "title": "ViralMango Influencer Search API",
    "version": "1.0.0",
    "description": "Public, read-only search over ViralMango's 450M+ influencer profile database (Instagram, TikTok, YouTube). Returns matching creators with follower counts and verification status. This is the same endpoint that powers the analytics.viralmango.com homepage autocomplete.",
    "contact": { "name": "ViralMango", "url": "https://analytics.viralmango.com" }
  },
  "servers": [
    { "url": "https://panel.viralmango.com", "description": "Production" }
  ],
  "paths": {
    "/api/s/search": {
      "post": {
        "operationId": "searchInfluencer",
        "summary": "Search influencers by name or @username",
        "description": "Returns creators matching the query on the given platform. No authentication required.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": { "type": "string" },
            "description": "Influencer name or @username to search for."
          },
          {
            "name": "platform",
            "in": "query",
            "required": false,
            "schema": { "type": "string", "enum": ["instagram", "tiktok", "youtube"], "default": "instagram" },
            "description": "Platform to search. Defaults to instagram."
          }
        ],
        "responses": {
          "200": {
            "description": "Matching influencers.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "search": {
                      "type": "array",
                      "items": { "$ref": "#/components/schemas/Influencer" }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Influencer": {
        "type": "object",
        "properties": {
          "user_id": { "type": "string", "description": "Stable platform user id." },
          "username": { "type": "string", "description": "Handle without the @." },
          "fullname": { "type": "string", "description": "Display name." },
          "picture": { "type": "string", "format": "uri", "description": "Avatar URL." },
          "followers": { "type": "integer", "description": "Follower count." },
          "is_verified": { "type": "boolean", "description": "Platform-verified badge." }
        }
      }
    }
  }
}
