# 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:** 48 total users, 10 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.15 / 1,000 prepaid search credits

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

## 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(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 '{
  "url": "https://www.apify.com/",
  "proxy": {
    "useApifyProxy": true
  }
}' |
apify call canadesk/spyfu-ppe --silent --output-dataset

```

## MCP server setup

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

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/U52GYVG9SOseNUaPP/builds/61gFBHuNxUQLCuviN/openapi.json
