{
  "openapi": "3.0.1",
  "info": {
    "title": "Instagram B2B Email Scraper: Business Type Leads",
    "description": "📧 Instagram B2B Email Scraper extracts business emails from public Instagram profiles, bios & linked websites—fast. 🔎 Build targeted B2B lead lists, enrich contacts & power outreach. 🚀 Ideal for sales & B2B marketing. ⚡ Scalable, accurate & easy—CSV export. #leadgen",
    "version": "1.0",
    "x-build-id": "SVVeGgpOsycCcrqC9"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapio~instagram-b2b-email-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapio-instagram-b2b-email-scraper",
        "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/scrapio~instagram-b2b-email-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapio-instagram-b2b-email-scraper",
        "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/scrapio~instagram-b2b-email-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapio-instagram-b2b-email-scraper",
        "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": {
          "discoveryMode": {
            "title": "🧭 Discovery channel",
            "enum": [
              "keyword",
              "hashtag",
              "mentions"
            ],
            "type": "string",
            "description": "🔍 keyword = classic Google-SERP search (this actor's base mode, no login needed). 🏷️ hashtag = real Instagram hashtag search API (requires sessionId below). 👤 mentions = mine who a target account mentions/tags in its own posts (no login needed).",
            "default": "keyword"
          },
          "discoveryTargets": {
            "title": "🎯 Keywords / target accounts",
            "type": "array",
            "description": "🔍 keyword mode: Google search terms (e.g. marketing, fitness). 👤 mentions mode: Instagram usernames to mine for @mentions/tagged users. Ignored in hashtag mode. (Fallback-compatible with the base 'keywords' field.)",
            "items": {
              "type": "string"
            }
          },
          "hashtags": {
            "title": "🏷️ Hashtags to search",
            "type": "array",
            "description": "🏷️ Hashtags to query via the real Instagram top_serp API (with or without '#'). Only used when discoveryMode='hashtag'.",
            "items": {
              "type": "string"
            }
          },
          "sessionId": {
            "title": "🔑 Instagram sessionId (required for hashtag mode only)",
            "type": "string",
            "description": "🍪 Paste your Instagram 'sessionid' browser cookie here. REQUIRED ONLY when discoveryMode='hashtag' — Instagram's hashtag search API rejects anonymous requests. Not needed for 'keyword' or 'mentions' modes. Treat it like a password."
          },
          "emailMatchMode": {
            "title": "📬 Email matching mode",
            "enum": [
              "b2b",
              "personal"
            ],
            "type": "string",
            "description": "👤 personal = Gmail/Outlook-style discovery | 🏢 b2b = corporate email patterns. Applies to whichever discovery channel is active. (Fallback-compatible with the base 'mode' field.)"
          },
          "personalEmailDomains": {
            "title": "✉️ Personal email domains",
            "type": "array",
            "description": "👤 Personal mode only: keep emails ending in these domains (e.g. @gmail.com, @outlook.com). Ignored in B2B mode. (Fallback-compatible with the base 'customDomains' field.)",
            "items": {
              "type": "string"
            }
          },
          "b2bPatternKeys": {
            "title": "🧩 B2B search pattern keys",
            "type": "array",
            "description": "🏢 keyword mode + B2B only: empty = run ALL patterns; or list specific keys from b2b_patterns.py (e.g. email_for_bookings, bio_email_basic). (Fallback-compatible with the base 'patterns' field — now genuinely wired in, unlike the base's dead 'selectedPatterns' lookup.)",
            "items": {
              "type": "string"
            }
          },
          "targetPlatform": {
            "title": "🌐 Target platform",
            "enum": [
              "Instagram.com"
            ],
            "type": "string",
            "description": "📱 Target social platform for keyword-mode Google discovery. Hashtag/mentions channels always target instagram.com directly. (Fallback-compatible with the base 'platform' field.)"
          },
          "geoFilter": {
            "title": "📍 Geographic filter",
            "type": "string",
            "description": "🗺️ Location text added to keyword-mode search queries, and tagged onto every row's 'location' field for all channels (e.g. London, New York). Leave empty for global. (Fallback-compatible with the base 'location' field.)"
          },
          "maxLeads": {
            "title": "📊 Maximum total leads",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "🎯 Overall cap on rows collected across all keywords/hashtags/accounts, for any discovery channel. (Fallback-compatible with the base 'maxEmails' field.)"
          },
          "maxLeadsPerSegment": {
            "title": "🔢 Max leads per segment",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "📈 Cap per segment: per B2B pattern (keyword mode), per hashtag (hashtag mode), or per scanned target account (mentions mode). (Fallback-compatible with the base 'maxEmailsPerPattern' field.)"
          },
          "enrichProfile": {
            "title": "🧬 Enrich With Real Profile Data",
            "type": "boolean",
            "description": "✅ Fetch each discovered lead's live Instagram profile (followers count, business account flag, business category, verified status, bio, external URL) via the public web_profile_info endpoint, plus a list of related/lookalike profiles. Applies to all three discovery channels. Off by default (adds one extra request per lead).",
            "default": false
          },
          "maxRelatedProfiles": {
            "title": "🔗 Max Related Profiles Per Lead",
            "minimum": 0,
            "maximum": 50,
            "type": "integer",
            "description": "🕸️ Maximum number of lookalike/related profiles to capture per enriched lead. Only applies when 🧬 Enrich With Real Profile Data is ON.",
            "default": 5
          },
          "extractPhone": {
            "title": "📱 Extract Phone Numbers",
            "type": "boolean",
            "description": "✅ In keyword mode, also scan each Google result snippet for a phone number and normalize it with a country dial code. Off by default — leaves phoneNumber/dialCode/country as null so you know the field wasn't attempted.",
            "default": false
          },
          "country": {
            "title": "🌎 Target Country / Dial Code",
            "type": "string",
            "description": "🌍 Country name and/or dial code to target phone numbers by (e.g. 'United Kingdom (+44)', 'United States', or just '+91'). Only used when 📱 Extract Phone Numbers is ON.",
            "default": ""
          },
          "disableSmartProxy": {
            "title": "🚫 Disable smart proxy",
            "type": "boolean",
            "description": "☑️ Leave UNCHECKED for the recommended default (smart proxy enabled, matching this actor's base behavior). Check this ONLY to force direct connections with no proxy escalation at all. (Inverted, fallback-compatible with the base 'useProxy' field — now genuinely wired in, unlike the base's dead 'useProxy' read.)"
          },
          "proxyConfiguration": {
            "title": "⚙️ Advanced proxy settings",
            "type": "object",
            "description": "🔧 Optional proxy override. Leave as default for best performance across all three discovery channels."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}