# Instagram Email Sniper (`mohamedgb00714/instagram-email-sniper`) Actor

Scrapes Instagram profiles for publicly available data, including usernames and potentially emails.

- **URL**: https://apify.com/mohamedgb00714/instagram-email-sniper.md
- **Developed by:** [mohamed el hadi msaid](https://apify.com/mohamedgb00714) (community)
- **Categories:** Social media, Lead generation
- **Stats:** 284 total users, 1 monthly users, 100.0% runs succeeded, 10 bookmarks
- **User rating**: 4.00 out of 5 stars

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

````markdown
## Instagram Email & Profile Scraper Actor

This Apify actor scrapes publicly available data from Instagram profiles, including usernames and potentially email addresses. **Important:** Due to Instagram's robust anti-scraping measures, directly scraping email addresses is extremely difficult and often impossible. This actor prioritizes ethical scraping practices and focuses on publicly accessible data. Be aware of Instagram's terms of service and `robots.txt` before using this actor. Scraping personal data without consent is unethical and potentially illegal.

### Input

The actor accepts the following input fields:

*   **`keywords` (required):** An array of keywords to search for on Instagram. This is used to find relevant profiles. Example: `["photography", "travel", "food"]`
*   **`locations` (optional):** An array of locations to refine the search. Example: `["New York", "London"]`
*   **`gmail` (optional, default: `true`):** Include Gmail addresses in the search.
*   **`yahoo` (optional, default: `true`):** Include Yahoo addresses in the search.
*   **`outlook` (optional, default: `true`):** Include Outlook/Hotmail addresses in the search.
*   **`aol` (optional, default: `true`):** Include AOL addresses in the search.
*   **`icloud` (optional, default: `true`):** Include iCloud addresses in the search.
*   **`protonmail` (optional, default: `true`):** Include ProtonMail addresses in the search.
*   **`other` (optional, default: `false`):** Include addresses from other providers specified in `extraEmailProviders`.
*   **`extraEmailProviders` (optional):** An array of additional email providers to include if `other` is `true`. Example: `["example.com", "another.net"]`
*   **`maxProfiles` (optional, default: `100`):** The maximum number of profiles to scrape per keyword. This helps to avoid overwhelming the actor and respect Instagram's rate limits.

Example input:

```json
{
  "keywords": ["photography", "travel"],
  "locations": ["New York", "London"],
  "gmail": true,
  "yahoo": false,
  "outlook": true,
  "aol": false,
  "icloud": false,
  "protonmail": false,
  "other": false,
  "extraEmailProviders": [],
  "maxProfiles": 50
}
````

### Output

The actor outputs an array of objects, where each object represents an Instagram profile. The output includes the following fields (availability may vary depending on the profile's privacy settings and Instagram's restrictions):

- **`url`:** The URL of the Instagram profile.
- **`username`:** The username of the profile (if available).
- **`emails`:** An array of email addresses found on the profile (if available).
- **`...other profile data`:** Other publicly available profile data that can be scraped (number of followers, bio, etc.). You will need to add the scraping logic for these in `routes.js`.

Example output:

```json
[
  {
    "url": "[https://www.instagram.com/example_user/](https://www.instagram.com/example_user/)",
    "username": "example_user",
    "emails": ["[email address removed]", "[email address removed]"]
    // ... other data
  },
  {
    "url": "[https://www.instagram.com/another_user/](https://www.instagram.com/another_user/)",
    "username": "another_user",
    "emails": [] // Or null if no emails are found
    // ... other data
  }
]
```

### Usage

1. **Install Apify CLI:** If you don't have it already, install the Apify CLI: `npm install -g apify-cli`
2. **Clone the Actor:** Clone this repository (or create a new Apify actor and copy the code).
3. **Install Dependencies:** `npm install`
4. **Run the Actor:** `apify run --purge --input '{"keywords": ["your_keywords"], "locations": ["your_locations"], "gmail": true, "yahoo": true, "outlook": true, "aol": true, "icloud": true, "protonmail": true, "other": false, "extraEmailProviders": [], "maxProfiles": 100}'` (Replace the example input with your desired values). You can also provide the input via `input.json` file.
5. **View Results:** The results will be stored in the Apify dataset. You can view them using the Apify CLI or in the Apify Console.

### Important Notes

- **Instagram's Anti-Scraping:** Instagram actively blocks scraping. Directly scraping email addresses is extremely difficult and often impossible. This actor focuses on publicly available profile information, but even that might be restricted by Instagram.
- **Ethical Considerations:** Always respect Instagram's terms of service and `robots.txt`. Scraping personal data without consent is unethical and potentially illegal. Use this actor responsibly.
- **Rate Limiting:** Be mindful of Instagram's rate limits. Implement delays and error handling to avoid being blocked.
- **Selector Adjustments:** The HTML structure of Instagram and Google Search can change, which may require you to update the CSS selectors in `routes.js` to extract the desired data. Use your browser's developer tools to inspect the HTML and find the correct selectors.
- **Proxies:**  Using proxies is highly recommended to avoid IP bans.  The actor is configured to use the Apify proxy by default.  You can configure your own proxies if needed.
- **Email Extraction Limitations:**  Even if emails are found, their accuracy and validity are not guaranteed. They could be outdated or fake.

### Disclaimer

This actor is provided for educational purposes only. The author is not responsible for any misuse of this actor. Use this actor at your own risk. Always comply with Instagram's terms of service and respect users' privacy.

# Actor input Schema

## `keywords` (type: `array`):

An array of keywords to search for on Instagram. At least one keyword is required.

## `locations` (type: `array`):

An optional array of locations to refine the search.

## `gmail` (type: `boolean`):

Include Gmail addresses.

## `yahoo` (type: `boolean`):

Include Yahoo addresses.

## `outlook` (type: `boolean`):

Include Outlook/Hotmail addresses.

## `aol` (type: `boolean`):

Include AOL addresses.

## `icloud` (type: `boolean`):

Include iCloud addresses.

## `protonmail` (type: `boolean`):

Include ProtonMail addresses.

## `other` (type: `boolean`):

Include addresses from other providers specified in 'extraEmailProviders'.

## `extraEmailProviders` (type: `array`):

An array of additional email providers to include if 'other' is enabled in 'emailProviders'.

## `maxProfiles` (type: `integer`):

Maximum number of profiles to scrape per keyword.  Helps to avoid overwhelming the actor and respect Instagram's rate limits.

## Actor input object example

```json
{
  "keywords": [
    "mohamedgb00714"
  ],
  "gmail": true,
  "yahoo": true,
  "outlook": true,
  "aol": true,
  "icloud": true,
  "protonmail": true,
  "other": false,
  "maxProfiles": 100
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "keywords": [
        "mohamedgb00714"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("mohamedgb00714/instagram-email-sniper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "keywords": ["mohamedgb00714"] }

# Run the Actor and wait for it to finish
run = client.actor("mohamedgb00714/instagram-email-sniper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "keywords": [
    "mohamedgb00714"
  ]
}' |
apify call mohamedgb00714/instagram-email-sniper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,mohamedgb00714/instagram-email-sniper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/R35geOuAPUSd8joKD/builds/Bbu5LwWDDCicnDDQ9/openapi.json
