# 🌐 Download HTML from URLs (`scraper-engine/download-html-from-urls`) Actor

🌐 Download HTML from any URL instantly! Scrape page source with accuracy for research, monitoring & parsing. 🚀 Perfect for developers, data analysts, and SEO workflows needing clean HTML snapshots. ⚡ Fast, reliable & easy to use.

- **URL**: https://apify.com/scraper-engine/download-html-from-urls.md
- **Developed by:** [Scraper Engine](https://apify.com/scraper-engine) (community)
- **Categories:** Developer tools, Automation, SEO tools
- **Stats:** 2 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.99 / 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.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#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

## 🌐 Download HTML from URLs

**Download the complete HTML of any list of web pages — fast, reliable, and at scale.** Paste your URLs (bulk supported), press Start, and get the full page source of every URL saved neatly into a dataset you can export as JSON, CSV, or Excel.

The actor uses a smart two-stage download engine: a lightning-fast HTTP fetch first, and an automatic **real-browser rendering fallback** for pages that need JavaScript or block simple clients. Blocked requests trigger an automatic **proxy escalation ladder** (direct → datacenter → residential), so you get your HTML even from protected sites.

### ✨ Why Choose Us?

- 🚀 **Fast by default** — direct connections and parallel downloads, no wasted proxy traffic.
- 🛡️ **Self-healing on blocks** — automatically falls back to datacenter and then residential proxies, and keeps the stronger proxy for the rest of the run.
- 🎭 **Browser rendering fallback** — pages that fail plain HTTP get rendered in a real headless Chromium browser.
- 💾 **Live results** — every page is saved to the dataset the moment it finishes, so even interrupted runs keep their data.
- 🔗 **Flexible input** — URLs with or without `https://`, bulk paste, file upload, or Google Sheets.

### 🔑 Key Features

- Bulk URL input (`requestListSources` editor — paste lists, upload files, link sheets)
- Full page HTML (`fullHtml`) **and** extracted `<body>` HTML (`html`) per page
- Automatic retries with exponential backoff (configurable)
- Configurable concurrency, page timeout, and polite request delays
- Detailed per-URL debug info (`#debug`) — status code, retries, error messages, proxy tier

### 📥 Input

```json
{
  "startUrls": [
    { "url": "https://apify.com/" },
    { "url": "example.com" }
  ],
  "proxyConfiguration": { "useApifyProxy": false },
  "pageTimeoutSecs": 60,
  "maxRetries": 3,
  "maxConcurrency": 5,
  "requestDelaySecs": 0
}
```

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `startUrls` | array | — | **Required.** List of URLs to download. Missing schemes default to `https://`. |
| `proxyConfiguration` | object | no proxy | Proxy settings. By default requests go direct; on blocks the actor escalates to datacenter → residential automatically. |
| `pageTimeoutSecs` | integer | `60` | Max seconds to spend downloading one page. |
| `maxRetries` | integer | `3` | Extra attempts for a failing URL. |
| `maxConcurrency` | integer | `5` | Pages downloaded in parallel. |
| `requestDelaySecs` | number | `0` | Optional polite delay before each request (jitter added). |

### 📤 Output

One dataset record per URL:

```json
{
  "url": "https://apify.com/",
  "finishedAt": "2026-06-10T10:14:29.693Z",
  "fullHtml": "<!DOCTYPE html><html>...</html>",
  "html": "<body>...</body>"
}
```

| Field | Description |
|-------|-------------|
| `url` | The downloaded URL. |
| `finishedAt` | UTC timestamp when the page finished downloading. |
| `fullHtml` | Complete HTML source of the page. |
| `html` | Just the `<body>...</body>` portion. |
| `#debug` | Hidden field with status code, retry count, error messages, and the proxy tier used. |
| `#error` | Hidden boolean — `true` if no HTML could be retrieved. |

### 🚀 How to Use (Apify Console)

1. Log in at [console.apify.com](https://console.apify.com) → **Actors**.
2. Open **Download HTML from URLs**.
3. Paste your URLs into **🔗 Website URLs** (bulk paste works!).
4. Optionally tweak proxy, timeout, retries, and concurrency.
5. Click **Start** and watch the live progress logs.
6. Open the **Output** tab when the run completes.
7. Export to JSON / CSV / XLSX with one click.

### 🤖 Use via API

```bash
curl -X POST "https://api.apify.com/v2/acts/%3CACTOR_ID%3E/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
     -H "Content-Type: application/json" \
     -d '{"startUrls":[{"url":"https://apify.com/"}]}'
```

### 💼 Best Use Cases

- 📰 Archiving article or product pages
- 🔎 Feeding HTML into your own parsers / LLM pipelines
- 🧪 Monitoring page content and structure changes
- 🗂️ Bulk snapshotting of competitor or partner sites
- 🤖 Pre-fetching pages for downstream AI extraction Actors

### 💰 Pricing

This actor uses the **pay-per-event** model with one simple event:

| Event | Charged when |
|-------|--------------|
| `page-downloaded` | A page's HTML is successfully downloaded and saved to the dataset. |

Failed URLs are **never charged**. When your spending limit is reached, the run stops gracefully and keeps everything collected so far.

### ❓ Frequently Asked Questions

**Do I need a proxy?**
Usually not — the actor starts with direct connections. If a site blocks the request, it escalates to datacenter and then residential proxies automatically.

**Does it render JavaScript?**
Yes, when needed. Pages that fail the fast HTTP download are automatically rendered in a real headless browser.

**Can I paste URLs without `https://`?**
Yes — `example.com` is automatically converted to `https://example.com`.

**What happens to URLs that fail completely?**
They're still saved to the dataset with an empty `fullHtml` and full error details in `#debug`, so you always know exactly what happened — and you're not charged for them.

### ⚖️ Legal

This actor downloads only **publicly available** web pages. You are responsible for complying with the target websites' terms of service and applicable laws (GDPR, CCPA, etc.) when using the downloaded data.

### 💬 Support and Feedback

Found a bug or need a feature? Open an issue on the actor's **Issues** tab in Apify Console — we respond quickly!

# Actor input Schema

## `startUrls` (type: `array`):

📋 List of page URLs to download. Bulk input supported — paste as many as you like! URLs without a scheme (e.g. <code>example.com</code>) are automatically converted to <code>https://example.com</code>. You can also upload a file or link a Google Sheet.

## `pageTimeoutSecs` (type: `integer`):

Maximum time to wait for a single page to download before it is retried or marked as failed.

## `maxRetries` (type: `integer`):

How many extra attempts to make for a failing URL before giving up on it.

## `useChrome` (type: `boolean`):

The downloader will use a real Chrome browser instead of a Chromium masking as Chrome. Using this option may help with bypassing certain anti-scraping protections, but risks that the scraper will be unstable or not work at all.

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

🌍 By default the actor connects <b>directly (no proxy)</b> for maximum speed. If a website blocks the request, it automatically falls back to a <b>datacenter proxy</b>, and then to a <b>residential proxy</b> (with extra retries). Once escalated, the stronger proxy is kept for all remaining URLs. 💪

## Actor input object example

```json
{
  "startUrls": [
    "https://apify.com/",
    "https://example.com/"
  ],
  "pageTimeoutSecs": 60,
  "maxRetries": 3,
  "useChrome": false,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# 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 = {
    "startUrls": [
        "https://apify.com/",
        "https://example.com/"
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("scraper-engine/download-html-from-urls").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 = {
    "startUrls": [
        "https://apify.com/",
        "https://example.com/",
    ],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("scraper-engine/download-html-from-urls").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 '{
  "startUrls": [
    "https://apify.com/",
    "https://example.com/"
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call scraper-engine/download-html-from-urls --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scraper-engine/download-html-from-urls"
        }
    }
}

```

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/3f6KziaRfUQRBPQEA/builds/4KmrcxLUAg1L2bboP/openapi.json
