# Website Traffic Analytics API - Visits, Engagement, Ranks (`nabeelbaghoor/website-traffic-analytics-api`) Actor

Get estimated website traffic and engagement for any list of domains: visits, page views, pages per visit, bounce rate, average visit duration, device split, global rank, country rank and industry rank. Pay per result. Bring your own API key.

- **URL**: https://apify.com/nabeelbaghoor/website-traffic-analytics-api.md
- **Developed by:** [Nabeel Hassan](https://apify.com/nabeelbaghoor) (community)
- **Categories:** Business, Developer tools, SEO tools
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$12.00 / 1,000 website metric rows

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Website Traffic Analytics API - Visits, Engagement, Ranks

Get estimated traffic and engagement for any list of websites and export it as a clean table. Pull visits, page views, pages per visit, bounce rate, average visit duration, the desktop versus mobile split, global rank, country rank and industry rank, month by month, week by week or day by day. You pay only for the rows you actually receive.

This actor is built for competitive benchmarking, market and category research, lead qualification by web traffic, investment and diligence screening, and any workflow that needs traffic estimates for many domains at once rather than one dashboard at a time.

### What you can do with it

- Benchmark your website against a list of competitors on the same metrics and period.
- Track visits and engagement for a portfolio of domains month over month.
- Qualify inbound leads or a prospect list by how much traffic each company's site gets.
- Screen an industry and see where each domain ranks globally, in a country, and in its industry.
- Measure the desktop versus mobile web split for a set of sites.
- Export everything as JSON, CSV or Excel, or push it into your BI tool or warehouse.

### Features

- Nine metrics, selected per run: visits, page views, pages per visit, bounce rate, average visit duration, device split, global rank, country rank, industry rank.
- Many domains per run, with URLs normalised to bare hosts automatically.
- Monthly, weekly or daily granularity, or the most recent 28 days when no dates are set.
- Worldwide or per-country reporting through a two-letter country code.
- Options for main domain only, month to date, verified data and engaged visits only.
- One tidy row per domain and period, with every selected metric merged into the same row.
- Only the query parameters each endpoint actually supports are sent, so rank and split metrics are not broken by granularity settings that do not apply to them.
- A missing metric for one domain is skipped with a warning instead of ending the run.
- Pay-per-row pricing with a hard row cap so a run can never surprise you.

### Input

| Field | Type | Description |
| --- | --- | --- |
| `domains` | array | Websites to analyse, one per line. Required. |
| `metrics` | array | Which of the nine metrics to collect. |
| `startDate` / `endDate` | string | Period in `YYYY-MM`. Leave blank for the last 28 days. |
| `granularity` | string | `monthly`, `weekly` or `daily`. |
| `country` | string | Two-letter ISO country code, or `world`. |
| `mainDomainOnly` | boolean | Exclude subdomains. |
| `monthToDate` | boolean | Extend the end date to the latest available day. |
| `showVerified` | boolean | Include shared verified analytics data where available. |
| `engagedVisitsOnly` | boolean | Filter engagement metrics to engaged visits. |
| `maxResults` | integer | Stop after this many rows (1 to 5,000). |
| `apiKey` | string | Your API key. Required, stored securely. |

#### How rows are counted

One row is one domain and one period. Six months of monthly data for four domains is 24 rows, whichever metrics you select, because all selected metrics for the same domain and month are merged into a single row. If you select only rank and split metrics, which have no time series, you get one row per domain.

### Example output

```json
{
  "domain": "example.com",
  "date": "2026-05-01",
  "visits": 18422190.5,
  "pageViews": 74180302.1,
  "pagesPerVisit": 4.03,
  "bounceRate": 0.3871,
  "averageVisitDurationSeconds": 232.7,
  "globalRank": 4192,
  "countryRank": 812,
  "desktopVisitShare": 0.3282,
  "mobileWebVisitShare": 0.6718,
  "industry": "Computers_Electronics_and_Technology/Programming_and_Developer_Software",
  "industryRank": 37
}
```

Bounce rate and the device shares are fractions between 0 and 1, average visit duration is in seconds, and ranks are 1-based where 1 is the largest site.

### Pricing and the credit model

This actor uses pay-per-result pricing. You are charged a fixed price for each row delivered to the dataset, and nothing for a run that returns no data. Set `maxResults` to cap how many rows a run can collect, and set a run spending limit as a second safety net. Separately from this actor's price, each metric you select costs one request or data credit per domain against your own provider account, so selecting fewer metrics is cheaper on both sides.

### Bring your own API key

This actor connects to a third-party website traffic analytics provider (Similarweb) on your behalf and requires your own provider API key. An administrator on your account generates the key in the account settings, selects the user it belongs to, and switches it on in the activation column. A key that has been created but not activated returns an invalid key error. Paste the key into the `apiKey` input; it is stored securely and never logged, and the actor never ships with or shares credentials.

### Frequently asked questions

#### What data does this actor return?

Estimated website traffic and engagement per domain and period: visits, page views, pages per visit, bounce rate and average visit duration, plus the desktop and mobile web visit shares, global rank, country rank, and the site's industry and its rank inside that industry.

#### How far back does the history go?

Historical data goes back up to 37 months, depending on what your subscription includes. Ask for a period inside your entitlement, otherwise the provider returns no data for the months outside it.

#### How do I get an API key?

The API is a subscription add-on on the provider side. An account administrator generates the key from the account settings, assigns it to a user, and activates it. Only activated keys return data.

#### Why did one metric come back empty?

Metrics are entitled per subscription and per country, and some domains simply have too little traffic to estimate. When the provider has no data for one metric on one domain, the actor logs a warning, skips that metric, and keeps everything else for that domain rather than failing the run.

#### Can I get daily data?

Yes, set the granularity to `daily` or `weekly`. Daily and weekly granularity require a subscription that includes them. Leaving both dates blank and choosing daily or weekly returns the most recent 28 days.

#### Does country apply to every metric?

No. Global rank is worldwide by definition and industry rank is not country-scoped, so the actor does not send a country to those endpoints. The country applies to visits, engagement metrics, the device split and country rank.

#### How am I charged on this actor?

You pay a fixed price per row returned to the dataset. A run that returns nothing costs nothing. Use `maxResults` and the run spending limit to control cost.

#### What output formats are available?

The dataset can be exported as JSON, CSV, Excel, HTML or RSS, or read through the API for pushing into a BI tool or warehouse.

### Keyword map

website traffic api, web traffic estimates, traffic analytics api, competitor traffic analysis, monthly visits data, bounce rate data, pages per visit, average visit duration, desktop vs mobile traffic, global website rank, country rank, industry rank, website benchmarking, digital market intelligence, competitive analysis data, lead qualification by traffic, site engagement metrics, domain analytics, web analytics api, traffic data export.

# Actor input Schema

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

The websites to analyse, one per line, e.g. `example.com`. Full URLs are accepted and reduced to their host automatically, and `www.` is stripped. Each domain is queried for every selected metric.

## `metrics` (type: `array`):

Which metrics to collect for each domain. Each selected metric is one request per domain against your own account, so pick only what you need.

## `startDate` (type: `string`):

First month to report, in `YYYY-MM` format, e.g. `2026-01`. Leave both dates blank to get the most recent 28 days instead.

## `endDate` (type: `string`):

Last month to report, in `YYYY-MM` format, e.g. `2026-06`. Leave both dates blank to get the most recent 28 days instead.

## `granularity` (type: `string`):

How finely to break the period down. Daily and weekly data need a subscription that includes them.

## `country` (type: `string`):

Two-letter ISO country code to report on, e.g. `us`, `gb`, `de`, or `world` for worldwide. Defaults to `world`. Only countries your subscription covers will return data.

## `mainDomainOnly` (type: `boolean`):

When enabled, report the main domain only and exclude its subdomains. Off by default.

## `monthToDate` (type: `boolean`):

When enabled, the end date is moved to the latest day of data available in the current month.

## `showVerified` (type: `boolean`):

When enabled, include shared analytics data for sites that have verified their traffic, where available.

## `engagedVisitsOnly` (type: `boolean`):

When enabled, engagement metrics are filtered to engaged visits only.

## `maxResults` (type: `integer`):

Stop after this many rows (1-5,000). One row is one domain and one period, so twelve months of monthly data for one domain is twelve rows. You are charged per row returned.

## `apiKey` (type: `string`):

Your own API key for the data provider. Required. An administrator generates it in your account settings, and it must be switched on in the activation column before it returns data. Stored securely and never logged.

## Actor input object example

```json
{
  "domains": [
    "amazon.com"
  ],
  "metrics": [
    "visits",
    "pagesPerVisit",
    "bounceRate",
    "averageVisitDuration",
    "globalRank"
  ],
  "granularity": "monthly",
  "country": "world",
  "mainDomainOnly": false,
  "monthToDate": false,
  "showVerified": false,
  "engagedVisitsOnly": false,
  "maxResults": 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 = {
    "domains": [
        "amazon.com"
    ],
    "maxResults": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("nabeelbaghoor/website-traffic-analytics-api").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": ["amazon.com"],
    "maxResults": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("nabeelbaghoor/website-traffic-analytics-api").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 '{
  "domains": [
    "amazon.com"
  ],
  "maxResults": 100
}' |
apify call nabeelbaghoor/website-traffic-analytics-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=nabeelbaghoor/website-traffic-analytics-api",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

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