# Ahrefs Top Websites Ranking (`xtracto/ahrefs-top-websites`) Actor

The most-visited websites ranked by estimated monthly organic search traffic, with category and month-over-month change. Global or per-country. One row per website.

- **URL**: https://apify.com/xtracto/ahrefs-top-websites.md
- **Developed by:** [Farhan Febrian Nauval](https://apify.com/xtracto) (community)
- **Categories:** SEO tools, Lead generation
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## Ahrefs Top Websites Ranking

The world's most-visited websites ranked by estimated monthly organic search traffic — with category, traffic figure and month-over-month change. Global or per-country.

### Why use this actor

- **Ranked list of the biggest sites on the web**, by estimated search traffic
- **Month-over-month change on every row** — spot who is climbing and who is sliding
- **Category labels** (Reference, Entertainment, Online Communities, …) for slicing the market
- **Per-country rankings** as well as the global list
- Traffic given both as published (`4B`) and as a plain number (`4000000000`) so you can sort and chart it
- No account and no key required

### How it works

1. You pick the global ranking, or one or more countries.
2. The actor reads the ranking pages, 100 websites per page, for as many pages as you allow.
3. Each website becomes one row with its rank, category, traffic and change.
4. Results stream into your dataset, ready to download as JSON, CSV or Excel.

Ranks stay true across pages — page 2 starts at 101, not back at 1 — so you can pull several pages and still sort the whole list correctly.

### Input

```json
{
  "countries": [],
  "maxItems": 200,
  "maxPages": 2,
  "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
}
```

| Field | Type | Description |
|---|---|---|
| `countries` | array | Country wording from the site address, e.g. `united-states`, `india`. Empty = global ranking. |
| `maxItems` | integer | Maximum websites collected across the run. Default 200. |
| `maxPages` | integer | Ranking pages per country; each page lists 100 websites. Default 2. |
| `proxyConfiguration` | object | Optional for small runs. |

### Output

Real sample from a live run:

```json
{
  "_input": "global",
  "_source": "S1-ranking",
  "_scrapedAt": "2026-08-26T09:02:31Z",
  "recordType": "WEBSITE_RANK",
  "rank": 1,
  "domain": "wikipedia.org",
  "category": "Reference",
  "organicTrafficText": "4B",
  "organicTraffic": 4000000000,
  "trafficChangeText": "+85.6M",
  "trafficChange": 85600000
}
```

Top of that run:

| rank | domain | category | traffic | change |
|---|---|---|---|---|
| 1 | wikipedia.org | Reference | 4B | +85.6M |
| 2 | youtube.com | Entertainment | 2.4B | +39M |
| 3 | instagram.com | Online Communities | 1.9B | +189M |
| 5 | google.com | Internet & Telecom | 1.3B | +26.9M |
| 6 | chatgpt.com | Computers & Electronics | 1.3B | −21.8M |

| Field | Type | Description |
|---|---|---|
| `rank` | integer | Position in the ranking (absolute across pages). |
| `domain` | string | The website. |
| `category` | string | Category label, where one is published. |
| `organicTrafficText` | string | Traffic as shown, e.g. `4B`. |
| `organicTraffic` | integer | The same figure as a plain number, for sorting. |
| `trafficChangeText` | string | Change as shown, e.g. `+85.6M`. |
| `trafficChange` | integer | The change as a plain number (negative when falling). |

### Notes and limits

- **This is the public ranking only.** Backlink counts, domain rating and keyword tools are not included — those sit behind a separate check on the site and are deliberately out of scope here.
- Traffic figures are **estimates** published by Ahrefs, not measured analytics.
- Country rankings restart at rank 1; the global list and each country list are separate rankings.
- A page that returns nothing produces an error row explaining why, so a gap never silently looks like an empty ranking.

# Actor input Schema

## `countries` (type: `array`):

Optional. Country wording exactly as it appears in the site address, e.g. "united-states", "united-kingdom", "india". Leave empty for the global ranking.

## `maxItems` (type: `integer`):

Maximum number of websites to collect across the whole run.

## `maxPages` (type: `integer`):

How many ranking pages to walk per country. Each page lists 100 websites.

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

Optional. Not required for small runs; a proxy helps when collecting many pages or several countries.

## Actor input object example

```json
{
  "countries": [],
  "maxItems": 200,
  "maxPages": 2,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `rank` (type: `string`):

Position in the ranking. Whole number.

## `domain` (type: `string`):

Domain the row belongs to.

## `category` (type: `string`):

Category the item belongs to.

## `organicTrafficText` (type: `string`):

Organic Traffic Text as reported by the source.

## `trafficChangeText` (type: `string`):

Traffic Change Text as reported by the source.

## `_input` (type: `string`):

The input value this row was produced from.

## `_scrapedAt` (type: `string`):

UTC timestamp of the scrape, ISO 8601.

## `recordType` (type: `string`):

Which kind of row this is.

## `organicTraffic` (type: `string`):

Organic Traffic as reported by the source.

## `trafficChange` (type: `string`):

Traffic Change as reported by the source.

## `sourceUrl` (type: `string`):

Link to the source.

## `_source` (type: `string`):

Which extraction strategy produced the row.

## `_error` (type: `string`):

Set only on diagnostic rows - why that target produced no data.

## `_errorDetail` (type: `string`):

Extra context for the error.

# 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 = {
    "countries": [],
    "maxItems": 200,
    "maxPages": 2
};

// Run the Actor and wait for it to finish
const run = await client.actor("xtracto/ahrefs-top-websites").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 = {
    "countries": [],
    "maxItems": 200,
    "maxPages": 2,
}

# Run the Actor and wait for it to finish
run = client.actor("xtracto/ahrefs-top-websites").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 '{
  "countries": [],
  "maxItems": 200,
  "maxPages": 2
}' |
apify call xtracto/ahrefs-top-websites --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,xtracto/ahrefs-top-websites"
        }
    }
}
```

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/c06umwXvPCL5KdTIf/builds/mmf9eJXXnqO75gS5P/openapi.json
