# Proxy Page to Markdown scraper (`morph_coder/proxy-page-to-markdown`) Actor

Fetches pages through Apify proxy in your chosen country (residential or datacenter). Returns clean markdown per URL; optional unique outbound domains for brand checks. Cheerio first, Playwright fallback. Social URLs → blocked\_social.

- **URL**: https://apify.com/morph\_coder/proxy-page-to-markdown.md
- **Developed by:** [Olek Coder](https://apify.com/morph_coder) (community)
- **Categories:** SEO tools, Other
- **Stats:** 2 total users, 0 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 markdown 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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

## Proxy Page to Markdown scraper

Fetch web pages through **Apify Proxy in a country you choose** (residential or datacenter) and get **clean markdown** per URL. Optional **outbound domain** extraction for brand or affiliate checks. Uses fast HTTP (Cheerio) first, then **Playwright** when the page needs rendering.

**Actor ID:** `olek_automate~proxy-page-to-markdown`

> This Actor is **not affiliated** with any third-party website you scrape. You are responsible for complying with each site's terms of use and applicable laws.

### Features

- Geo-targeted requests via Apify Proxy (`country` + `RESIDENTIAL` / `DATACENTER`)
- One dataset row per input URL (including failures and blocked social URLs)
- Readability-based main content → markdown with links preserved
- Optional external links: one sample URL per external **domain** (filtered share buttons, analytics, assets)
- Social profile/post URLs → `blocked_social` (use dedicated social Actors instead)

### Input

| Field | Default | Description |
|-------|---------|-------------|
| `country` | `US` | Two-letter ISO proxy country (required) |
| `urls` | `https://example.com` | Page URLs to scrape (max `maxUrls` per run) |
| `batchSize` | `50` | Internal batch size (10–100) |
| `maxUrls` | `1000` | Hard cap on URLs per run |
| `extractExternalLinks` | `false` | Unique external domains (brand/leak checks) |
| `maxExternalLinks` | `100` | Max domains per page when links enabled |
| `usePlaywrightFallback` | `true` | Retry thin Cheerio results with Chrome |
| `minContentLength` | `200` | Min markdown length before Playwright |
| `proxyType` | `RESIDENTIAL` | `RESIDENTIAL` or `DATACENTER` |

### Output

Each input URL produces **one dataset item**.

| `status` | Meaning |
|----------|---------|
| `success_static` | Markdown via HTTP/Cheerio |
| `success_rendered` | Markdown via Playwright |
| `blocked_social` | Social URL — not scraped |
| `failed_fetch` | HTTP or network error |
| `failed_dynamic` | Empty content after Playwright |
| `failed_timeout` | Request timeout |

#### Example (success)

```json
{
  "url": "https://example.com",
  "country": "US",
  "status": "success_static",
  "title": "Example Domain",
  "markdown": "## Example Domain\n\nThis domain is for use in illustrative examples...",
  "externalLinks": null,
  "method": "cheerio",
  "httpStatus": 200,
  "errorMessage": null,
  "fetchedAt": "2026-05-23T12:00:00.000Z",
  "billable": true
}
````

#### Example (`blocked_social`)

```json
{
  "url": "https://www.instagram.com/someprofile/",
  "country": "US",
  "status": "blocked_social",
  "platform": "instagram",
  "blockedReason": "social_network_not_supported",
  "message": "Social network URLs are blocked. Use a dedicated social scraper Actor.",
  "markdown": null,
  "billable": false
}
```

### Pricing

When the Actor uses **pay-per-event** pricing on Apify Store:

- Successful web scrapes (`success_static`, `success_rendered`) charge the **`scraped-url`** event (once per URL).
- `blocked_social` and failed statuses are **not** charged for that event.

You also pay standard **Apify platform usage** (compute, proxy traffic) according to your plan. Residential proxy traffic is typically higher than datacenter.

Check the **Pricing** tab on this Actor's Store page for current event prices.

### Run from API

```http
POST https://api.apify.com/v2/acts/olek_automate~proxy-page-to-markdown/runs?token=YOUR_TOKEN
Content-Type: application/json

{
  "country": "US",
  "urls": ["https://example.com"],
  "extractExternalLinks": false
}
```

Read results from the run's `defaultDatasetId` (one item per URL). Use webhooks on `ACTOR.RUN.SUCCEEDED` for automation.

### Limits and tips

- Up to **1000 URLs** per run; the Actor batches internally (`batchSize`, default 50).
- Use `extractExternalLinks: true` mainly for **landing / brand** pages, not large blogs or news sites.
- Some sites block proxies or return 502 — item will be `failed_fetch`.
- For Instagram, Facebook, LinkedIn, TikTok, X, YouTube, Reddit URLs expect `blocked_social`, not markdown.

### Support

Open an issue from the Actor page or contact the publisher. For development and deployment notes, see [DEVELOPMENT.md](DEVELOPMENT.md) in the repository.

# Actor input Schema

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

Two-letter country code for Apify proxy geolocation (e.g. US, DE, UA).

## `urls` (type: `array`):

List of direct page URLs. Social network URLs are returned as blocked\_social without scraping.

## `batchSize` (type: `integer`):

Number of URLs processed per wave (memory control).

## `maxUrls` (type: `integer`):

Hard cap on URLs accepted per run.

## `extractExternalLinks` (type: `boolean`):

One sample URL per external domain, filtered for brand/leak checks — not for blogs/news. Off by default.

## `maxExternalLinks` (type: `integer`):

Cap on unique outbound domains when extractExternalLinks is true (one URL per domain).

## `usePlaywrightFallback` (type: `boolean`):

Retry thin/empty Cheerio results with headless Chrome.

## `minContentLength` (type: `integer`):

Markdown shorter than this triggers Playwright fallback (if enabled).

## `proxyType` (type: `string`):

Apify proxy group hint.

## Actor input object example

```json
{
  "country": "US",
  "urls": [
    "https://example.com"
  ],
  "batchSize": 50,
  "maxUrls": 1000,
  "extractExternalLinks": false,
  "maxExternalLinks": 100,
  "usePlaywrightFallback": true,
  "minContentLength": 200,
  "proxyType": "RESIDENTIAL"
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset with markdown and status per URL.

# 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 = {
    "country": "US",
    "urls": [
        "https://example.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("morph_coder/proxy-page-to-markdown").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 = {
    "country": "US",
    "urls": ["https://example.com"],
}

# Run the Actor and wait for it to finish
run = client.actor("morph_coder/proxy-page-to-markdown").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 '{
  "country": "US",
  "urls": [
    "https://example.com"
  ]
}' |
apify call morph_coder/proxy-page-to-markdown --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=morph_coder/proxy-page-to-markdown",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Proxy Page to Markdown scraper",
        "description": "Fetches pages through Apify proxy in your chosen country (residential or datacenter). Returns clean markdown per URL; optional unique outbound domains for brand checks. Cheerio first, Playwright fallback. Social URLs → blocked_social.",
        "version": "0.0",
        "x-build-id": "2L4BAORPfkKDat7K9"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/morph_coder~proxy-page-to-markdown/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-morph_coder-proxy-page-to-markdown",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/morph_coder~proxy-page-to-markdown/runs": {
            "post": {
                "operationId": "runs-sync-morph_coder-proxy-page-to-markdown",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/morph_coder~proxy-page-to-markdown/run-sync": {
            "post": {
                "operationId": "run-sync-morph_coder-proxy-page-to-markdown",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "country",
                    "urls"
                ],
                "properties": {
                    "country": {
                        "title": "Proxy country (ISO code)",
                        "type": "string",
                        "description": "Two-letter country code for Apify proxy geolocation (e.g. US, DE, UA).",
                        "default": "US"
                    },
                    "urls": {
                        "title": "URLs to scrape",
                        "type": "array",
                        "description": "List of direct page URLs. Social network URLs are returned as blocked_social without scraping.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "batchSize": {
                        "title": "Internal batch size",
                        "minimum": 10,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Number of URLs processed per wave (memory control).",
                        "default": 50
                    },
                    "maxUrls": {
                        "title": "Maximum URLs",
                        "minimum": 1,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Hard cap on URLs accepted per run.",
                        "default": 1000
                    },
                    "extractExternalLinks": {
                        "title": "Extract external links",
                        "type": "boolean",
                        "description": "One sample URL per external domain, filtered for brand/leak checks — not for blogs/news. Off by default.",
                        "default": false
                    },
                    "maxExternalLinks": {
                        "title": "Max external domains per page",
                        "minimum": 1,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Cap on unique outbound domains when extractExternalLinks is true (one URL per domain).",
                        "default": 100
                    },
                    "usePlaywrightFallback": {
                        "title": "Use Playwright fallback",
                        "type": "boolean",
                        "description": "Retry thin/empty Cheerio results with headless Chrome.",
                        "default": true
                    },
                    "minContentLength": {
                        "title": "Minimum content length",
                        "minimum": 50,
                        "type": "integer",
                        "description": "Markdown shorter than this triggers Playwright fallback (if enabled).",
                        "default": 200
                    },
                    "proxyType": {
                        "title": "Proxy type",
                        "enum": [
                            "RESIDENTIAL",
                            "DATACENTER"
                        ],
                        "type": "string",
                        "description": "Apify proxy group hint.",
                        "default": "RESIDENTIAL"
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
