# Spyfu (`canadesk/spyfu-ppe`) Actor

Extract competitors, keywords, ads, and domain statistics from Spyfu (public website).

- **URL**: https://apify.com/canadesk/spyfu-ppe.md
- **Developed by:** [Canadesk Support](https://apify.com/canadesk) (community)
- **Categories:** Lead generation, SEO tools, E-commerce
- **Stats:** 32 total users, 5 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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

## SpyFu Scraper (PPE)

A robust scraper for SpyFu using the Pay-Per-Event (PPE) pricing model. Extract competitors, keywords, ads, and domain statistics.

ℹ️ This is scraping SpyFu public website and will not provide you with data behind a paywall.

### Features

- **Top Competitors**: Get paid and organic competitors with overlap and traffic data.
- **Most Valuable Keywords**: Extract high-value keywords for a domain.
- **Most Successful Keywords**: Find keywords driving the most success.
- **Newly Ranked Keywords**: Discover keywords that recently started ranking.
- **Top Ads**: Scrape ad copy and history.
- **Domain Statistics**: Get comprehensive domain performance metrics.

### Pricing

This Actor uses the **Pay-Per-Event** model. You are charged only for the number of items successfully scraped.

### Input Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `url` | String | The domain URLs to analyze (comma-separated or new lines). |
| `process` | String | The operation to perform (e.g., `tc` for Top Competitors). |
| `country` | String | Country code (e.g., `US`). Default: `US`. |
| `proxy` | Object | Proxy configuration. **Apify Residential Proxy** is recommended. |

### Output

Data is stored in the default dataset in JSON format.

#### Example: Top Competitors

```json
{
  "searchQuery": "apify.com",
  "domain": "competitor.com",
  "overlap": 1234,
  "commonTerms": 567,
  "organicTraffic": 10000,
  "paidTraffic": 500,
  "budget": 1000.00,
  "type": "organic"
}
```

#### Example: Keywords

```json
{
  "keyword": "web scraping",
  "rank": 1,
  "searchVolume": 5000,
  "cpc": 2.50,
  "clicks": 100,
  "value": 250.00
}
```

### Notes

- **Proxies**: This scraper is optimized for Apify Residential Proxies.
- **Limits**: The actor is configured to retrieve up to 10,000 results per run to maximize data collection.

# Actor input Schema

## `url` (type: `string`):

The URLs of websites you want to get the data from (comma-separated or new lines).

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

Default country to look for.

## `process` (type: `string`):

Select the process to run.

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

Select proxies to be used by your crawler.

## Actor input object example

```json
{
  "url": "https://www.apify.com/",
  "country": "US",
  "process": "tc",
  "proxy": {
    "useApifyProxy": true
  }
}
```

# 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 = {
    "url": "https://www.apify.com/",
    "proxy": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("canadesk/spyfu-ppe").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 = {
    "url": "https://www.apify.com/",
    "proxy": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("canadesk/spyfu-ppe").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 '{
  "url": "https://www.apify.com/",
  "proxy": {
    "useApifyProxy": true
  }
}' |
apify call canadesk/spyfu-ppe --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/U52GYVG9SOseNUaPP/builds/61gFBHuNxUQLCuviN/openapi.json
