# URL to Markdown API for LLMs: Web Page Reader and Web Search (`nabeelbaghoor/url-to-markdown-reader-api`) Actor

Convert any URL or PDF to clean, LLM-ready markdown, text or HTML, and search the web with each top result already read into markdown. CSS selectors, link and image summaries, screenshots, country and language search, via the Jina Reader API. Bring your own key.

- **URL**: https://apify.com/nabeelbaghoor/url-to-markdown-reader-api.md
- **Developed by:** [Nabeel Hassan](https://apify.com/nabeelbaghoor) (community)
- **Categories:** AI, Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 page read into markdowns

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

## URL to Markdown API for LLMs: Web Page Reader and Web Search

Convert any URL or PDF into clean, LLM-ready markdown, and search the web with every top result already read into markdown, as rows you can export to CSV, Excel or JSON or feed straight into your model.

This actor wraps the Jina Reader API from Jina AI: POST r.jina.ai/ to read a URL and POST s.jina.ai/search to search the web. Use it for retrieval augmented generation, AI agent tool calls, LLM grounding, knowledge base ingestion, documentation and PDF conversion, content monitoring and research. Bring your own Jina API key.

BYOK, not live tested: every route, field and response shape comes from Jina's own OpenAPI descriptions (r.jina.ai/openapi.json and s.jina.ai/openapi.json) and the jina-ai/reader README, and both routes were probed on 2026-11-07 with an invalid key of realistic length. The routes have not been run against a live key.

### What it does

- **URL to markdown**: one row per URL with `title`, `description`, `url`, `domain`, clean markdown `content`, `contentLength`, `publishedTime`, the page's `httpStatus` and any `warning`. Works on JavaScript-heavy single page apps and PDF links.
- **Other formats**: plain text, HTML, or a link to a screenshot of the first screen or the full page.
- **Precise extraction**: keep only the elements matching a CSS selector, remove nav, footer or ads by selector, wait for late content, remove overlays, trim to a token limit.
- **Link and image summaries**: a deduplicated list of every link (`links`, `linkCount`) and image (`images`, `imageCount`) on the page.
- **Web search for LLMs**: one row per result with `position`, `title`, `url`, `description` and the result page read into markdown, with country, language, location, news and in-site search.

### What you need

A Jina AI account and its API key. The actor never signs up or buys anything for you, and it never uses Jina's keyless access.

1. Log in at jina.ai and open the API dashboard (key manager).
2. Copy your API key (it starts with `jina_`).
3. Paste it into the **Jina API key** field (or set the DATA_API_KEY secret). The key is sent only as a Bearer token to r.jina.ai and s.jina.ai and is removed from every log line and message.

Jina bills its own tokens to that account: a read costs tokens in proportion to the page's content, and each search reads several pages.

### Input

| Field | Modes | Notes |
| --- | --- | --- |
| `mode` | all | `read` (default), `search` |
| `apiKey` | all | your Jina API key; falls back to the DATA_API_KEY secret |
| `urls` | read | one URL per line, PDFs included |
| `targetSelector`, `removeSelector`, `waitForSelector` | read | CSS selectors |
| `engine` | read | `auto`, `browser`, `curl`, `cf-browser-rendering` |
| `preset` | read | `none`, `reader`, `index`, `research`, `agent`, `spider` |
| `proxyCountry`, `locale` | read | such as `us`, `en-US` |
| `tokenBudget`, `removeOverlay` | read | reject over-budget pages; strip overlays |
| `queries` | search | one query per line |
| `resultsPerQuery` | search | 1 to 20, default 5 |
| `resultsPage` | search | page of results |
| `country`, `language`, `location` | search | such as `us`, `en`, `Berlin, Germany` |
| `sites` | search | restrict to these domains |
| `searchType` | search | `web`, `news` |
| `provider` | search | `any`, `google`, `bing` |
| `respondWith` | all | `content` (default), `markdown`, `text`, `html`, `screenshot`, `pageshot` |
| `retainImages`, `retainLinks` | all | how images and links survive into the content |
| `withLinksSummary`, `withImagesSummary`, `withGeneratedAlt` | all | summaries and image captions |
| `noCache`, `timeoutSecs`, `maxTokens` | all | fresh fetch, wait up to 180 s, trim content |
| `maxResults` | all | stop after this many rows, default 100 |

Inputs for the other mode are ignored with a warning.

### Output

A page read row (the values are illustrative):

```json
{
    "recordType": "page",
    "found": true,
    "mode": "read",
    "query": "https://en.wikipedia.org/wiki/Web_scraping",
    "title": "Web scraping - Wikipedia",
    "description": "Data scraping used for extracting data from websites",
    "url": "https://en.wikipedia.org/wiki/Web_scraping",
    "domain": "en.wikipedia.org",
    "content": "**Web scraping**, **web harvesting**, or **web data extraction** is data scraping used for extracting data from websites. [...]",
    "contentLength": 48213,
    "publishedTime": "2026-10-30T12:04:11Z",
    "links": [{ "text": "Data scraping", "url": "https://en.wikipedia.org/wiki/Data_scraping" }],
    "linkCount": 412,
    "httpStatus": 200
}
```

A search result row carries `recordType` `searchResult`, the `query`, `position`, `title`, `url`, `domain`, `description`, the page `content` and `publishedTime`. A URL or query that fails becomes a free row with `found` false and a `note` with Jina's own error message.

### Pricing

Pay per event, only for rows with data:

| Event | Price |
| --- | --- |
| Page read into markdown | $0.01 |
| Web search result | $0.008 |

Jina bills its tokens to your Jina account, separately from this actor. Skipped lines, empty pages, failed URLs and refused requests are free.

### FAQ

#### What is the Jina Reader API?

Jina Reader is a service from Jina AI (now part of Elastic) that turns any URL into clean, LLM-friendly markdown by rendering the page in a headless browser and extracting its main content. Its companion s.jina.ai searches the web and reads the top results the same way.

#### How do I convert a URL to markdown?

Choose Page read, paste one URL per line and run. Each URL comes back as one row with the main content as clean markdown in `content`. Choose Markdown, Plain text or HTML under Output format for other forms.

#### Can it read PDFs?

Yes. Put a PDF link in Page URLs and Jina returns its text as markdown, with `numPages` when known.

#### How do I extract only part of a page?

Set Keep only this CSS selector (for example `article`) to return just that element, or Remove this CSS selector (for example `nav, footer`) to drop clutter. Wait for this CSS selector helps with content that loads late.

#### How is the web search different from a Google SERP scraper?

A SERP scraper returns titles, links and short snippets. Jina search returns the top results with each page already read into markdown, so a RAG pipeline or AI agent can use the content directly without fetching and cleaning each page.

#### Can I search only one website, or only news?

Yes. List domains under Search only these sites for in-site search, and set Search type to News for news results. Country, language and location localise the results.

#### Can I use the output in my own product?

Your agreement with Jina AI applies. Its terms place no restriction on what you do with the output, but forbid using the service to build a competing service. Content from third party pages remains subject to its owners' rights.

#### What do I pay?

$0.01 per page read and $0.008 per search result to this actor, plus the Jina tokens your key uses. Failed URLs, empty pages and refused requests are free.

### Keyword map

URL to markdown, website to markdown, HTML to markdown API, web page reader API, PDF to markdown, LLM-ready web content, web scraper for LLMs, RAG data ingestion, web search API for LLMs, AI agent web search, in-site search, Jina Reader, Jina AI Reader API, r.jina.ai, s.jina.ai.

### Routes and verification

| Mode | Route | Probe with an invalid 65 character jina\_ key (twice) |
| --- | --- | --- |
| Page read | POST r.jina.ai/ | 401 JSON AuthenticationFailedError "Invalid API key" |
| Web search | POST s.jina.ai/search | 401 JSON AuthenticationFailedError "Invalid API key" |
| Invented control route | POST r.jina.ai/v9/readz | 422 SubmittedDataMalformedError: the unknown path is read as a URL ("Domain 'v9' could not be resolved") |

### Licensing and data use

This actor works only with your own Jina key, and your agreement with Jina AI applies: no restriction on the output, no use of the service to build a competing service. Jina bills tokens to the key's account. Content returned from third party web pages remains subject to its owners' rights. This actor is not affiliated with or endorsed by Jina AI or Elastic.

# Actor input Schema

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

Each mode calls one documented Jina Reader API route with your own API key: POST r.jina.ai/ to read URLs, POST s.jina.ai/search to search the web. Nothing is written to your Jina account.

## `apiKey` (type: `string`):

Your own Jina AI API key (starts with jina\_), from the API dashboard on jina.ai. Sent only as a Bearer token to r.jina.ai and s.jina.ai and removed from every log line. Jina bills its tokens to that account. Leave empty to use the DATA_API_KEY secret.

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

Page read. One full URL per line (HTML pages, single page apps and PDF links). Each URL is one Jina read request and one row.

## `targetSelector` (type: `string`):

Page read. Return only the content inside the elements matching this CSS selector, such as article or main .content. Reader also waits for it to appear.

## `removeSelector` (type: `string`):

Page read. Remove elements matching this CSS selector before conversion, such as nav, footer, .ads.

## `waitForSelector` (type: `string`):

Page read. Wait until an element matching this CSS selector is rendered before returning. Useful for pages that load content late.

## `engine` (type: `string`):

Page read. auto lets Jina choose; browser renders JavaScript in headless Chrome; curl fetches raw HTML fast; cf-browser-rendering uses Cloudflare browser rendering.

## `preset` (type: `string`):

Page read. A Jina option bundle for common uses; options you set yourself still win.

## `proxyCountry` (type: `string`):

Page read. Read through a Jina-provided proxy in this country, as a two-letter code such as us or de.

## `locale` (type: `string`):

Page read. Browser locale for the page, such as en-US or de-DE.

## `tokenBudget` (type: `integer`):

Page read. Reject a page (free row, no charge) when its content would cost more than this many Jina tokens.

## `removeOverlay` (type: `boolean`):

Page read. Remove overlay elements such as cookie banners and modals.

## `queries` (type: `array`):

Web search. One query per line; each query is one Jina search request returning the top results with their pages read.

## `resultsPerQuery` (type: `integer`):

Web search. How many results to return per query, 1 to 20 (the API maximum).

## `resultsPage` (type: `integer`):

Web search. Page of results to return, for paging past the first results.

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

Web search. Two-letter country code for the search, such as us, gb or de.

## `language` (type: `string`):

Web search. Interface language code for the search, such as en, de or zh-cn.

## `location` (type: `string`):

Web search. Location the search should originate from, such as Berlin, Germany.

## `sites` (type: `array`):

Web search. Restrict results to these domains, one per line, such as jina.ai or github.com.

## `searchType` (type: `string`):

Web search. Web results or news results.

## `provider` (type: `string`):

Web search. Which search backend Jina uses; any lets Jina choose.

## `respondWith` (type: `string`):

Both modes. content is the main content as clean markdown (the default); markdown converts the page to markdown; text and html return plain text or HTML; screenshot and pageshot return a link to a first-screen or full-page image.

## `retainImages` (type: `string`):

Both modes. Keep all images, drop them, keep only alt text, or add generated alt text (all_p, alt_p).

## `retainLinks` (type: `string`):

Both modes. Keep links, drop them, keep only anchor text, or use gpt-oss citation format.

## `withLinksSummary` (type: `boolean`):

Both modes. Add a deduplicated list of every link on the page as links (text and URL).

## `withImagesSummary` (type: `boolean`):

Both modes. Add a list of every image on the page as images (alt text and URL).

## `withGeneratedAlt` (type: `boolean`):

Both modes. Caption images that lack alt text with a vision model. Only with the default output format.

## `noCache` (type: `boolean`):

Both modes. Ignore Jina's cache and fetch each page fresh.

## `timeoutSecs` (type: `integer`):

Both modes. Wait up to this many seconds for a page to load, at most 180. When set, Reader waits for the page to settle instead of returning early.

## `maxTokens` (type: `integer`):

Both modes. Trim each page's content to at most this many tokens (at least 500).

## `maxResults` (type: `integer`):

Stop after this many rows in total. Rows past the limit are never requested or charged.

## Actor input object example

```json
{
  "mode": "read",
  "urls": [
    "https://en.wikipedia.org/wiki/Web_scraping"
  ],
  "engine": "auto",
  "preset": "none",
  "removeOverlay": false,
  "resultsPerQuery": 5,
  "searchType": "web",
  "provider": "any",
  "respondWith": "content",
  "retainImages": "all",
  "retainLinks": "all",
  "withLinksSummary": false,
  "withImagesSummary": false,
  "withGeneratedAlt": false,
  "noCache": false,
  "maxResults": 100
}
```

# Actor output Schema

## `records` (type: `string`):

One row per page read or search result.

# 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://en.wikipedia.org/wiki/Web_scraping"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("nabeelbaghoor/url-to-markdown-reader-api").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://en.wikipedia.org/wiki/Web_scraping"] }

# Run the Actor and wait for it to finish
run = client.actor("nabeelbaghoor/url-to-markdown-reader-api").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://en.wikipedia.org/wiki/Web_scraping"
  ]
}' |
apify call nabeelbaghoor/url-to-markdown-reader-api --silent --output-dataset

```

## MCP server setup

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

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/FRCwKrxzVm5XPb8Kx/builds/vtMbOodVR0txadHY1/openapi.json
