# Similarweb Scraper (`datapilot/similarweb-scraper`) Actor

Search and collect FDA drug approval records from the openFDA API. Extracts approval ID, drug name, sponsoring company, approval date, and official FDA application link. Supports keyword-based searches, pagination, duplicate filtering, automatic retries,

- **URL**: https://apify.com/datapilot/similarweb-scraper.md
- **Developed by:** [Data Pilot](https://apify.com/datapilot) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 scraped results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## 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

📈 **Similarweb Scraper** is a powerful Apify Actor designed to collect website traffic and ranking metrics from public Similarweb website pages. This tool provides **Similarweb Scraper** output including total visits, global rank, country rank, pages per visit, social network traffic distribution, and the page description for any domain you choose. Whether you're researching competitors, enriching a lead list, or comparing websites, the Similarweb Scraper delivers structured website analytics efficiently.

With domain or URL input, real browser rendering, a combination of page data and background API responses, number normalization (`K`, `M`, `B`), and Apify Dataset delivery, this **Similarweb Scraper** actor turns public Similarweb pages into clean records. It focuses on key signals including visits, rank, and social traffic, making **Similarweb Scraper** a practical tool for traffic research.

***

### 📋 Table of Contents

- [Features](#-features)
- [Data Source](#-data-source)
- [How It Works](#-how-it-works)
- [Input](#-input)
- [Output](#-output)
- [Technical Stack](#-technical-stack)
- [Data Fields](#-data-fields-explained)
- [Use Cases](#-use-cases)
- [Quick Start](#-quick-start)
- [Configuration](#-configuration)
- [Performance](#-performance)
- [Important Notes](#-important-notes)
- [License & Legal](#-license--legal)

***

### 🔥 Features

- **Website Traffic Metrics** – Collects total visits, global rank, country rank, and pages per visit. This is the core of **Similarweb Scraper**.
- **Social Traffic Distribution** – Captures the share of social traffic by network when the page shows it.
- **Domain or URL Input** – Accepts plain domains or full URLs, and cleans them (removes `https://`, `www.`, and paths).
- **Duplicate Removal** – Each domain is processed once per run.
- **Real Browser Rendering** – Loads pages in headless Chromium (Playwright) so client-side content is available.
- **Multiple Data Sources per Page** – Reads values from the page content and from background JSON responses, and falls back between them.
- **Number Normalization** – Converts values such as `1.2M` or `3.4B` into plain numbers.
- **Per-Domain Record** – Every domain produces one record, including domains that failed.
- **Apify Proxy Support** – Optional Apify Proxy for the headless browser.
- **Detailed Logging** – Logs progress and key metrics for every **Similarweb Scraper** run.

***

### 📊 Data Source

#### **Similarweb Public Website Pages**

- **Source**: `https://www.similarweb.com/website/<domain>/`
- **Access Method**: Headless Chromium via Playwright. The Actor reads the rendered page and also listens to JSON responses the page loads in the background.
- **Coverage**: Domains that have a public Similarweb page
- **Data**: Page description, visits, ranks, pages per visit, and social network shares, as displayed on the public page
- **Access**: No login or API key used
- **Update Frequency**: Reflects the page at time of run

Similarweb's figures are estimates published by Similarweb. The Actor does not record which time period the figures refer to. This Actor is not affiliated with or endorsed by Similarweb.

***

### ⚙️ How It Works

The Similarweb Scraper accepts a list of domains. For each domain it opens the public Similarweb page in a headless browser, waits for the page to settle, scrolls to trigger lazy content, and collects metrics from the page and from background API responses. Each domain becomes one record, and all records are pushed to the Apify Dataset as one batch.

**Key Processing Steps:**

1. **Input Parsing** – Read the `domains` list
2. **Domain Cleaning** – Strip scheme, `www.`, and paths, and remove duplicates
3. **Proxy Setup** – Configure Apify Proxy if enabled
4. **Browser Launch** – Start headless Chromium
5. **Page Load** – Open the Similarweb page and wait about 6 seconds for it to settle
6. **Scrolling** – Scroll the page three times to load lazy sections
7. **Extraction** – Read visits, ranks, pages per visit, and social shares from API responses and the page
8. **Record Building** – Create one record per domain
9. **Dataset Push** – Push all **Similarweb Scraper** records at once

***

### 📥 Input

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `domains` | array of strings | `["facebook.com"]` | Domains or URLs to look up. |
| `proxyConfiguration` | object | `{"useApifyProxy": true}` | Apify Proxy configuration. |

**Example Input:**

```json
{
  "domains": ["facebook.com", "https://www.example.com/page", "wikipedia.org"]
}
```

**Run Without Proxy:**

```json
{
  "domains": ["example.com"],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

***

### 📤 Output

One **Similarweb Scraper** record is pushed per domain:

| Field | Type | Description |
|-------|------|-------------|
| `name` | string | The cleaned domain |
| `url` | string | The Similarweb page that was loaded |
| `description` | string | Page meta description; see notes for fallback text |
| `totalVisits` | number | Total visits as shown on the page, or `0` if not found |
| `globalRank` | integer or null | Global rank |
| `countryRank` | integer or null | Country rank (the country is not included in the output) |
| `pagesPerVisit` | string | Pages per visit (for example `"4.52"`), or `"N/A"` |
| `socialNetworkDistribution` | array | List of `{ "network": "...", "percentage": 0.0 }` entries |
| `scrapedAt` | string | ISO 8601 UTC timestamp |

**Example Similarweb Scraper Record:**

```json
{
  "name": "example.com",
  "url": "https://www.similarweb.com/website/example.com/",
  "description": "example.com is ranked #1234 globally...",
  "totalVisits": 12500000,
  "globalRank": 1234,
  "countryRank": 456,
  "pagesPerVisit": "3.85",
  "socialNetworkDistribution": [
    { "network": "YouTube", "percentage": 42.5 },
    { "network": "Facebook", "percentage": 31.2 }
  ],
  "scrapedAt": "2026-10-30T09:00:00+00:00"
}
```

***

### 🧰 Technical Stack

- **Browser:** Playwright with headless Chromium, with basic settings to hide the browser automation flag
- **Data Sources:** Rendered page content, page meta description, and intercepted JSON responses
- **Async:** `asyncio`, one domain at a time with a 2 second pause between domains
- **Proxy:** Apify Proxy, optional via `useApifyProxy`
- **Logging:** Apify Actor logging system
- **Platform:** Apify Actor serverless environment

***

### 📊 Data Fields Explained

#### **Identification**

- **name / url**: The domain and the Similarweb page used

#### **Traffic**

- **totalVisits**: Visit count, converted from values like `12.5M`
- **pagesPerVisit**: Average pages viewed per visit

#### **Ranking**

- **globalRank / countryRank**: Rank numbers as shown by Similarweb

#### **Social**

- **socialNetworkDistribution**: Each network and its share of social traffic, in percent

#### **Metadata**

- **description / scrapedAt**: Page description and the collection time

***

### 🎯 Use Cases

- **Competitor Research** – Compare traffic and rank across competing websites
- **Lead Enrichment** – Add traffic estimates to a list of company domains
- **Market Research** – Gauge the relative size of websites in a market
- **Partnership & Advertising Research** – Shortlist sites by audience size
- **Content & SEO Research** – Check how visible and busy a site is
- **Trend Tracking** – Run on a schedule to watch estimates change over time

***

### 🚀 Quick Start

#### **1. Prepare Input**

Go to Apify Console and enter:

```json
{
  "domains": ["facebook.com"]
}
```

#### **2. Run the Actor**

Click **Start**. The Actor will:

- Launch headless Chromium
- Open the Similarweb page for each domain
- Extract the metrics
- Push one record per domain to the Dataset

#### **3. Monitor Progress**

Console shows:

```
🛡️ Apify Proxy connected for headless browser.
🔎 Starting Similarweb Scraper for 1 domain(s)...
[1/1] Extracting metrics for: facebook.com
Navigating to https://www.similarweb.com/website/facebook.com/...
✅ Scraped facebook.com | Visits: ... | Global Rank: #... | Country Rank: #...
🎉 Successfully pushed 1 record(s) to dataset!
Done!
```

The "Scraped" line is logged for every domain, including ones where no metrics were found. Always check the record itself.

#### **4. View & Download Results**

- **Results Tab**: One record per domain
- **Export**: JSON, CSV, Excel, or HTML
- **API Access**: Available via the Apify API

***

### ⚙️ Configuration

Several domains:

```json
{
  "domains": ["amazon.com", "ebay.com", "etsy.com"]
}
```

Direct connection without proxy:

```json
{
  "domains": ["example.com"],
  "proxyConfiguration": { "useApifyProxy": false }
}
```

***

### 📈 Performance

#### **Processing Speed**

- Domains are processed one at a time in a single browser
- Each domain takes roughly 15 seconds or more, because the Actor waits about 6 seconds for the page to settle and scrolls three times with short pauses, plus load time
- Page navigation times out after 45 seconds

#### **Resource Usage**

- Memory: Higher than HTTP-only Actors because a real browser runs
- Network: Loads full Similarweb pages
- Proxy: Optional Apify Proxy

***

### ⚠️ Important Notes

#### **Defaults and Failures**

- **Missing Visits**: If total visits cannot be found, `totalVisits` is `0`. A value of `0` can mean "not found", not "no traffic". Treat `0` as unknown.
- **Missing Ranks**: `globalRank` and `countryRank` are `null` when not found, and `pagesPerVisit` is `"N/A"`.
- **Description Fallback**: If no description is found, `description` contains the text `"Similarweb analytics for <domain>."`
- **Failed Domains**: If a domain fails (for example a timeout), the Actor still pushes a record with `description` set to `"Failed: <error>"`, `totalVisits` `0`, ranks `null`, and `pagesPerVisit` `"N/A"`.
- **Log Messages**: The "Scraped" log line appears even when no metrics were found, so check the record data.

#### **Data Quality**

- **Estimates**: Similarweb figures are third-party estimates, not exact counts, and the Actor does not record the time period they refer to.
- **Limited Public Data**: Public pages show only part of Similarweb's data, and some domains show little or none.
- **Page Changes**: The Actor reads page elements and background responses that can change without notice. If Similarweb changes its page, some fields may come back empty.
- **Anti-Bot Protection**: Similarweb may block automated browsers or show a verification page. Basic anti-detection settings are used and Apify Proxy is recommended, but results are not guaranteed.
- **Country Rank**: The country the rank refers to is not included in the output.
- **Social Shares**: Percentages are taken from the page when shown, otherwise from background data, and may be missing.

#### **Legal & Compliance**

- **Terms of Service**: Automated access to Similarweb may be restricted by its terms of use. Review them before using this Actor, especially for commercial purposes.
- **Public Data Only**: The Actor reads public pages without logging in
- **Affiliation**: Not affiliated with or endorsed by Similarweb
- **Legal**: Not legal advice

#### **Best Practices**

- Keep Apify Proxy enabled
- Run a small batch of domains first to check the results
- Treat `totalVisits` of `0` and `null` ranks as missing data
- Cross-check important figures on Similarweb before relying on them

***

### 📄 License & Legal

**Terms of Use:**

- Use for legitimate research and analysis
- Respect the terms of service of Similarweb
- Use data responsibly and in compliance with applicable laws

**Disclaimer:**
Similarweb Scraper is provided as-is for research purposes. It is not affiliated with or endorsed by Similarweb. Users are responsible for compliance with all applicable laws and the data source's terms. This is not legal advice.

***

### ⚖️ Similarweb Scraper Excellence

This Actor is optimized for **Similarweb Scraper** research with:

- ✅ Visits, global rank, country rank, and pages per visit
- ✅ Social traffic distribution
- ✅ Domain or URL input with cleaning and de-duplication
- ✅ Real browser rendering with API-response fallback
- ✅ One record per domain, including failures
- ✅ Production-ready code

# Actor input Schema

## `domains` (type: `array`):

List of domains to scrape (e.g., apify.com, openai.com, github.com).

## `proxyConfiguration` (type: `object`):

Apify Proxy settings (Residential proxy recommended for heavy volume).

## Actor input object example

```json
{
  "domains": [
    "apify.com"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `crawlResults` (type: `string`):

No description

## `overview` (type: `string`):

No description

# 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 = {
    "domains": [
        "apify.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("datapilot/similarweb-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 = { "domains": ["apify.com"] }

# Run the Actor and wait for it to finish
run = client.actor("datapilot/similarweb-scraper").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 '{
  "domains": [
    "apify.com"
  ]
}' |
apify call datapilot/similarweb-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,datapilot/similarweb-scraper"
        }
    }
}
```

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/JbioPRciYiEUOLlnc/builds/8T4h2WaKnJoGylLs5/openapi.json
