{
  "openapi": "3.0.1",
  "info": {
    "title": "Instagram Lead Generator w/AI",
    "description": "Discover and enrich Instagram leads from hashtags. Extract emails and phone numbers from bios, crawl external URLs for contact info, and score leads with AI.\n\nHashtag Discovery\nEmail/Phone Extraction\nExternal URL Crawling\nAI Lead Scoring\nSmart Filtering\nDeduplication",
    "version": "1.0",
    "x-build-id": "ktiWRqfNeTfZJYO4h"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/alizarin_refrigerator-owner~instagram-lead-generator-w-ai/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-alizarin_refrigerator-owner-instagram-lead-generator-w-ai",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/alizarin_refrigerator-owner~instagram-lead-generator-w-ai/runs": {
      "post": {
        "operationId": "runs-sync-alizarin_refrigerator-owner-instagram-lead-generator-w-ai",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/alizarin_refrigerator-owner~instagram-lead-generator-w-ai/run-sync": {
      "post": {
        "operationId": "run-sync-alizarin_refrigerator-owner-instagram-lead-generator-w-ai",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "hashtags": {
            "title": "Hashtags",
            "type": "array",
            "description": "Hashtags to search for leads (e.g., 'plumber', 'hvac', 'landscaping'). Don't include #.",
            "items": {
              "type": "string"
            }
          },
          "usernames": {
            "title": "Direct Usernames",
            "type": "array",
            "description": "Direct Instagram usernames to enrich (optional). Don't include @.",
            "items": {
              "type": "string"
            }
          },
          "sessionCookies": {
            "title": "Session Cookies (JSON)",
            "type": "string",
            "description": "JSON array of cookies from Cookie-Editor browser extension. REQUIRED for hashtag discovery — Instagram gates /explore/tags/ behind login. Install Cookie-Editor, log into Instagram, export cookies, paste here. Not needed if using Cookie Manager."
          },
          "cookieStorageKey": {
            "title": "Cookie Manager Storage Key",
            "type": "string",
            "description": "Key to load cookies from the Cookie Manager KV store (e.g. 'instagram-myaccount'). Use this instead of pasting cookies manually. Requires a prior run of the Cookie Manager actor to capture and store your session."
          },
          "cookieKvStoreName": {
            "title": "Cookie Manager KV Store Name",
            "type": "string",
            "description": "Name of the Key-Value store where Cookie Manager saved the session. Defaults to 'cookie-sessions'.",
            "default": "cookie-sessions"
          },
          "minFollowers": {
            "title": "Minimum Followers",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum follower count to qualify as a lead.",
            "default": 1000
          },
          "maxFollowers": {
            "title": "Maximum Followers",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum follower count (filters out mega-accounts).",
            "default": 1000000
          },
          "requireBio": {
            "title": "Require Biography",
            "type": "boolean",
            "description": "Only include profiles with a biography.",
            "default": true
          },
          "requireExternalUrl": {
            "title": "Require External URL",
            "type": "boolean",
            "description": "Only include profiles with an external website link.",
            "default": false
          },
          "requireEmail": {
            "title": "Require Email",
            "type": "boolean",
            "description": "Only include profiles where an email could be extracted.",
            "default": false
          },
          "excludePrivate": {
            "title": "Exclude Private Accounts",
            "type": "boolean",
            "description": "Skip private accounts.",
            "default": true
          },
          "maxLeadsPerHashtag": {
            "title": "Max Leads Per Hashtag",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum leads to collect per hashtag.",
            "default": 50
          },
          "maxTotalLeads": {
            "title": "Max Total Leads",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum total leads to collect.",
            "default": 200
          },
          "maxPostsToScan": {
            "title": "Posts to Scan Per Hashtag",
            "minimum": 10,
            "maximum": 500,
            "type": "integer",
            "description": "Number of posts to scan per hashtag for discovery.",
            "default": 100
          },
          "crawlExternalUrls": {
            "title": "Crawl External URLs",
            "type": "boolean",
            "description": "Crawl external URLs to find emails (requires Firecrawl API key).",
            "default": true
          },
          "firecrawlApiKey": {
            "title": "Firecrawl API Key",
            "type": "string",
            "description": "Your Firecrawl API key for website email extraction."
          },
          "enableLeadScoring": {
            "title": "Enable AI Lead Scoring",
            "type": "boolean",
            "description": "Use AI to score leads based on profile quality and relevance.",
            "default": false
          },
          "aiProvider": {
            "title": "AI Provider",
            "enum": [
              "openai",
              "anthropic",
              "google",
              "mistral",
              "none"
            ],
            "type": "string",
            "description": "AI provider for lead scoring.",
            "default": "none"
          },
          "aiApiKey": {
            "title": "AI API Key",
            "type": "string",
            "description": "API key for your chosen AI provider."
          },
          "aiModel": {
            "title": "AI Model",
            "type": "string",
            "description": "Specific model to use (optional). Defaults: gpt-4o-mini, claude-haiku-4.5, gemini-3-flash, mistral-small-latest."
          },
          "targetIndustry": {
            "title": "Target Industry",
            "type": "string",
            "description": "Industry context for AI lead scoring (e.g., 'plumbing', 'HVAC', 'landscaping').",
            "default": "local services"
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "URL to send results to when complete."
          },
          "demoMode": {
            "title": "Demo Mode",
            "type": "boolean",
            "description": "Run with sample data to test output format (required for QA tests).",
            "default": false
          },
          "proxy": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Proxy settings for scraping."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}