# Whatsapp scraper (`curious_coder/whatsapp-scraper`)

Scrape  whatsapp numbers in bulk and extract complete details including name, email, website, address, description, profile picture, etc

- **URL**: https://beta-securitybyobscurity.apify.com/curious\_coder/whatsapp-scraper.md
- **Developed by:** [Curious Coder](https://beta-securitybyobscurity.apify.com/curious_coder) (community)
- **Categories:** Social media, Lead generation
- **Stats:** 776 total users, 4 monthly users, 88.2% runs succeeded, 13 bookmarks
- **User rating**: 2.75 out of 5 stars

## Pricing

$25.00/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period.
You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#rental-actors

# README

Whatsapp contacts scraper lets you extract details of given whatsap numbers to get name, bio, locations, email, website, address, profile picture url, categories, business hours etc

### How to scrape whatsapp numbers

#### Step 1

Go to input tab of whatsapp scraper

#### Step 2

Enter the phone numbers you want to scrape, or copy paste list of numbers from your google sheet or csv file in bulk edit mode

#### Step 3

Run the scraper and wait for QR code

#### Step 4

It will ask you to scan the QR code when it is ready. To scan the QR code, go to 'Live view' tab. Open your whatsapp app on your phone and go to Whatsapp menu > Linkedin Devices  and click on 'Link a device' button and scan the QR code

#### Step 5

Once QR code is scanned successfully, you can go to 'Log' tab to see the status updates of the scraper as it scrapes the numbers you have passed to it

#### Step 6

Once it finishes scraping, you can export the scraped data to different format like CSV, JSON, XML, etc.

If you are for scrapers for finding leads, you should also give a try to these scrapers

- [Crunchbase Scraper](https://apify.com/curious_coder/crunchbase-scraper): Scrape leads, investors, companies and everything else from crunchbase search. It can easily get you more than 1k results scraped for free
- [Facebook group members scraper](https://apify.com/curious_coder/facebook-scraper) lets you scrape unlimited members from facebook groups of your competitor or your niche
- [Instagram Scraper - All in one](https://apify.com/curious_coder/instagram-scraper) lets you extract any kind data from instagram including followers, posts, likes, comments, profiles, etc

### Sample data

#### Scrape whatsapp profiles

```json
[
  {
    "businessProfile": {
      "id": {
        "server": "c.us",
        "user": "918976859807",
        "_serialized": "918976859807@c.us"
      },
      "tag": "102921066",
      "description": "India’s Highest Rated Food Delivery App: 4.7. \nFlat 30% OFF on every order. NO T&C. ZERO Delivery/Packaging Fees. Benefits on all Handpicked Partner Brands like BOX8, MOJO Pizza, Itminaan Biryani & more.",
      "categories": [
        {
          "id": "273819889375819",
          "localized_display_name": "Restaurant"
        }
      ],
      "profileOptions": {
        "commerceExperience": "none",
        "cartEnabled": true,
        "directConnection": false
      },
      "email": "hello@eatclub.in",
      "website": [
        "https://eatclub.page.link/qrid"
      ],
      "businessHours": null,
      "address": "No 548, 22nd Cross, 14th Main Road, HSR Layout Sector 3, Bangalore, Karnataka - 560102",
      "fbPage": {},
      "igProfessional": {},
      "isProfileLinked": false,
      "directConnection": {
        "enabled": false
      },
      "coverPhoto": null
    },
    "id": {
      "server": "c.us",
      "user": "918976859807",
      "_serialized": "918976859807@c.us"
    },
    "number": "918976859807",
    "isBusiness": true,
    "type": "in",
    "isMe": false,
    "isUser": true,
    "isGroup": false,
    "isWAContact": true,
    "isMyContact": false,
    "isBlocked": false,
    "about": "India’s Highest Rated Food Delivery App: 4.7",
    "profilePicUrl": "https://pps.whatsapp.net/v/t61.24694-24/328134927_579346797408337_6534925906918654566_n.jpg?ccb=11-4&oh=01_AdTENlu80Nd9A9D7bR3Llynpj2Bp0F5mr3yZJ9r_uO1lhA&oe=6511557C&_nc_sid=000000&_nc_cat=108",
    "givenNumber": "8976859807"
  }
]
```

### Use cases

#### Lead enrichment

If you got a list of phone numbers of businesses and looking to find emails, then you can pass them to whatsapp scraper and get website, email, etc from their whatsapp business profile. If you just get website, you can use it to find email address.

#### Phone number verification

You can verify whether a number is valid by checking if the number exists on whatsapp. Although this is not a best way to verify, you can use this method to shortlist and prioritise numbers that are active on whatsapp

# Actor input Schema

## `numbers` (type: `array`):

List of phone numbers to search on whatsapp

## `proxy` (type: `object`):

Make sure to select the country where your whatsapp number is currently logged in

## `sessionStoreId` (type: `string`):

ID or name of the Key-value store for storing and loading whatsapp session data for authentication. Use this value in future runs to avoid scanning QR code

## Actor input object example

```json
{
  "numbers": [
    "8976859807",
    "8655907795",
    "8860033772"
  ],
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  },
  "sessionStoreId": "whatsapp-session-1"
}
```

# 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 = {
    "numbers": [
        "8976859807",
        "8655907795",
        "8860033772"
    ],
    "proxy": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "US"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("curious_coder/whatsapp-scraper").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 = {
    "numbers": [
        "8976859807",
        "8655907795",
        "8860033772",
    ],
    "proxy": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "US",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("curious_coder/whatsapp-scraper").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "numbers": [
    "8976859807",
    "8655907795",
    "8860033772"
  ],
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}' |
apify call curious_coder/whatsapp-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=curious_coder/whatsapp-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Whatsapp scraper",
        "description": "Scrape  whatsapp numbers in bulk and extract complete details including name, email, website, address, description, profile picture, etc",
        "version": "1.0",
        "x-build-id": "YzKSvE7eAeOt9HgXj"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/curious_coder~whatsapp-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-curious_coder-whatsapp-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/curious_coder~whatsapp-scraper/runs": {
            "post": {
                "operationId": "runs-sync-curious_coder-whatsapp-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/curious_coder~whatsapp-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-curious_coder-whatsapp-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",
                "required": [
                    "numbers"
                ],
                "properties": {
                    "numbers": {
                        "title": "Phone numbers",
                        "type": "array",
                        "description": "List of phone numbers to search on whatsapp",
                        "items": {
                            "type": "string"
                        }
                    },
                    "proxy": {
                        "title": "Proxy",
                        "type": "object",
                        "description": "Make sure to select the country where your whatsapp number is currently logged in"
                    },
                    "sessionStoreId": {
                        "title": "Session store ID",
                        "type": "string",
                        "description": "ID or name of the Key-value store for storing and loading whatsapp session data for authentication. Use this value in future runs to avoid scanning QR code",
                        "default": "whatsapp-session-1"
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
