# Fast HTML Fetcher (`rixin/fast-html-fetcher`) Actor

From $0.2/1k reqs. Fast HTTP fetcher that returns raw HTML content, HTTP status codes, and response headers for any URL. Supports custom headers, user agent, proxy, redirect control, and SSL bypass. Perfect for web monitoring, content extraction, and API testing.

- **URL**: https://apify.com/rixin/fast-html-fetcher.md
- **Developed by:** [Rixin Sc](https://apify.com/rixin) (community)
- **Categories:** Developer tools, Integrations, Automation
- **Stats:** 129 total users, 24 monthly users, 96.3% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.01 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
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?

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

## HTTP URL Fetcher

Fetch any webpage and get the complete HTTP response including HTML content, status codes, and response headers. Built for speed and reliability.

### What does HTTP URL Fetcher do?

HTTP URL Fetcher is a simple but powerful tool that fetches web pages and returns all the raw data you need:

- **HTML Content**: Get the complete page source exactly as the server sends it
- **HTTP Status**: Know if requests succeed (200), redirect (3xx), or fail (4xx/5xx)
- **Response Headers**: Access all HTTP headers like Content-Type, Cache-Control, Set-Cookie, etc.
- **Redirect Tracking**: See both the original URL and final URL after redirects

### Features

- Fetch single or multiple URLs in one run
- Custom HTTP headers for authentication or special requirements
- Configurable User-Agent string
- Follow or ignore HTTP redirects
- Adjustable timeout and retry settings
- Apify Proxy support for avoiding blocks
- SSL certificate validation bypass for testing

### Input

| Field | Type | Required | Default | Description |
|-------|------|----------|---------|-------------|
| `urls` | array | Yes | - | List of URLs to fetch |
| `headers` | object | No | `{}` | Custom HTTP headers as key-value pairs |
| `userAgent` | string | No | Chrome 144 | Browser User-Agent string |
| `followRedirects` | boolean | No | `true` | Automatically follow redirects |
| `timeout` | integer | No | `10000` | Request timeout in milliseconds |
| `retries` | integer | No | `3` | Number of retry attempts for failed requests |
| `proxyConfiguration` | object | No | - | Apify Proxy settings |
| `ignoreSslErrors` | boolean | No | `false` | Skip SSL certificate validation |

#### Example Input

```json
{
    "urls": [
        "https://example.com/",
        "https://httpbin.org/get"
    ],
    "headers": {
        "Accept": "text/html"
    },
    "followRedirects": true,
    "timeout": 10000,
    "retries": 3
}
```

### Output

Each fetched URL produces a dataset item with:

| Field | Description |
|-------|-------------|
| `requestedUrl` | Original URL you requested |
| `finalUrl` | Final URL after redirects |
| `httpStatus` | HTTP status code (200, 404, 500, etc.) |
| `httpStatusText` | Status text (OK, Not Found, etc.) |
| `responseHeaders` | All response headers as object |
| `htmlContent` | Complete response body |
| `contentLength` | Response size in bytes |
| `fetchedAt` | Timestamp of the fetch |
| `error` | Error message if request failed |

#### Example Output

```json
{
    "requestedUrl": "https://example.com/",
    "finalUrl": "https://example.com/",
    "httpStatus": 200,
    "httpStatusText": "OK",
    "responseHeaders": {
        "content-type": "text/html; charset=UTF-8",
        "content-length": "1256",
        "cache-control": "max-age=604800"
    },
    "htmlContent": "<!doctype html><html>...</html>",
    "contentLength": 1256,
    "fetchedAt": "2024-01-15T10:30:00.000Z",
    "error": null
}
```

### Pricing

This Actor uses pay-per-event pricing:

| Event | Price | Description |
|-------|-------|-------------|
| URL Fetched | $0.0001 | Charged for each URL fetch attempt |
| Content Returned | $0.0001 | Charged when response has content |

**Example costs:**

- 1,000 URLs with content: ~$0.20
- 10,000 URLs with content: ~$2.00

### Use Cases

- **Website Monitoring**: Check if pages are up and returning expected status codes
- **Content Extraction**: Get raw HTML for parsing with your own tools
- **Header Analysis**: Inspect security headers, caching policies, cookies
- **Redirect Mapping**: Trace redirect chains from old URLs to new ones
- **API Testing**: Fetch API endpoints and inspect responses

### Integrations

The Actor integrates with any tool that works with Apify:

- **Apify API**: Trigger runs and retrieve results programmatically
- **Webhooks**: Get notified when runs complete
- **Integrations**: Connect with Zapier, Make, or other automation platforms

### FAQ

**Q: Can I fetch pages that require JavaScript?**
A: This Actor fetches raw HTTP responses only. For JavaScript-rendered pages, use a browser-based Actor.

**Q: What happens if a URL times out?**
A: The request is retried according to your retry settings. If all retries fail, an error is recorded in the output.

**Q: Does it work with authenticated pages?**
A: Yes, add your authentication headers (like cookies or Bearer tokens) in the `headers` input field.

**Q: Can I use my own proxy?**
A: Currently only Apify Proxy is supported. Enable it in the proxy configuration settings.

# Actor input Schema

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

List of webpage URLs to fetch. Each URL will be requested and its HTML content, HTTP status code, and response headers will be returned in the dataset.

## `headers` (type: `object`):

Custom HTTP headers to include with each request. Provide as key-value pairs in JSON format (e.g., {"Accept": "text/html", "Authorization": "Bearer token"}).

## `userAgent` (type: `string`):

Custom User-Agent header to identify the client making the request. Defaults to a standard Chrome browser user agent string.

## `followRedirects` (type: `boolean`):

Whether to automatically follow HTTP redirects (3xx responses). When enabled, the final response after all redirects is returned. When disabled, the redirect response itself is returned.

## `timeout` (type: `integer`):

Maximum time in milliseconds to wait for each request to complete. If a request takes longer than this, it will be aborted and retried according to the retry settings.

## `retries` (type: `integer`):

Number of times to retry a failed request before giving up. Retries use exponential backoff to avoid overwhelming the server.

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

Apify proxy configuration for routing requests through proxy servers. Enable Apify Proxy to avoid IP blocking and access geo-restricted content.

## `ignoreSslErrors` (type: `boolean`):

Whether to ignore SSL certificate validation errors such as self-signed, expired, or invalid certificates. Warning: Only enable this for testing or when absolutely necessary, as it reduces security.

## Actor input object example

```json
{
  "urls": [
    "https://example.com/"
  ],
  "headers": {},
  "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36",
  "followRedirects": true,
  "timeout": 10000,
  "retries": 3,
  "proxyConfiguration": {
    "useApifyProxy": false
  },
  "ignoreSslErrors": false
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

## `detailed` (type: `string`):

No description

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

// Run the Actor and wait for it to finish
const run = await client.actor("rixin/fast-html-fetcher").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 = { "urls": ["https://example.com/"] }

# Run the Actor and wait for it to finish
run = client.actor("rixin/fast-html-fetcher").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 '{
  "urls": [
    "https://example.com/"
  ]
}' |
apify call rixin/fast-html-fetcher --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,rixin/fast-html-fetcher"
        }
    }
}

```

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/CioCcYF8TS2Nqb1QA/builds/0To2SYISf9LDtuj76/openapi.json
