# Website to Markdown by FetchRelay (`investigative_liberty/fetchrelay-website-to-markdown`) Actor

Extract 1–10 public webpages into a Markdown dataset with your FetchRelay API key. Automatic browser fallback, per-page outcomes, and extraction warnings. Successful pages use your FetchRelay credits; Apify platform usage is separate.

- **URL**: https://apify.com/investigative\_liberty/fetchrelay-website-to-markdown.md
- **Developed by:** [Suraj Rajan](https://apify.com/investigative_liberty) (community)
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

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

## Website to Markdown by FetchRelay

Extract 1–10 public webpages into an Apify dataset using your own FetchRelay API key. This Actor calls the hosted FetchRelay API; it does not run a second scraping engine.

### Input

- `urls`: one to ten HTTP(S) URLs. Duplicate URLs are processed once.
- `fetchrelayApiKey`: your key, without `Bearer`. The input is marked secret.
- `mode`: `auto` (default), `http`, or `browser`.

Create a key at [FetchRelay](https://fetchrelay.com/account?utm_source=apify\&utm_medium=integration\&utm_campaign=apify-launch). Start with `https://example.com`.

### Output

Each dataset row contains `url`, `success`, and either `markdown`, `metadata`, `warnings`, or a safe `error` description. Review warnings and compare content to the source. Failed pages stay visible in the dataset. If every page fails, the Actor run fails. Account, allowance, and rate-limit errors stop the run; already-written rows are retained.

The `OUTPUT` record summarizes completed processing. No automatic retries are made. A network timeout can happen after FetchRelay completed a request, so check your usage before rerunning.

### Costs and data handling

You need both Apify and FetchRelay accounts. Apify platform usage is billed by Apify; successful pages consume your FetchRelay credits. There is no additional Actor rental fee in this initial distribution. Your key is sent only to `https://fetchrelay.com`, and redirects are not followed. URLs and results pass through both platforms. Never share input exports containing real credentials. FetchRelay's [privacy policy](https://fetchrelay.com/privacy) applies to its service; Apify controls Actor inputs and datasets.

### Development

Node 22 or newer. Run `npm ci`, `npm test`, then `npm start` with an Apify local input record or deploy through Apify's Git repository source using this subdirectory. The Docker image builds with `npm ci` using the committed lockfile.

# Actor input Schema

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

One to ten public HTTP(S) page URLs. Successful pages use your FetchRelay credits.

## `fetchrelayApiKey` (type: `string`):

Create a key at https://fetchrelay.com/account. Enter the key without Bearer.

## `mode` (type: `string`):

Auto tries HTTP before browser rendering when needed.

## Actor input object example

```json
{
  "urls": [
    "https://example.com"
  ],
  "mode": "auto"
}
```

# Actor output Schema

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

Markdown, metadata, warnings and per-page success or failure.

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

# Run the Actor and wait for it to finish
run = client.actor("investigative_liberty/fetchrelay-website-to-markdown").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 investigative_liberty/fetchrelay-website-to-markdown --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,investigative_liberty/fetchrelay-website-to-markdown"
        }
    }
}
```

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/cahGyGQBL6LiWQ9qK/builds/tWft2NsFFDvbRfFoi/openapi.json
