Home
Mastering r.jina.ai URL Format for Web to Markdown Conversion
To convert any web page into a clean, LLM-friendly Markdown format using Jina AI Reader, the primary URL format is to prepend https://r.jina.ai/ to the target website's address. For example, to read a Wikipedia page, the structure would be https://r.jina.ai/https://en.wikipedia.org/wiki/Main_Page.
This simple prefixing mechanism turns a complex, script-heavy HTML document into structured text that preserves headings, tables, and links while stripping away intrusive elements like navigation bars, cookie banners, and advertisements. For developers building Retrieval-Augmented Generation (RAG) systems or AI agents, mastering this URL format is the first step toward high-quality data ingestion.
Core URL Structure and Basic Usage
The elegance of the Jina AI Reader lies in its simplicity. It functions as a proxy that fetches, renders, and cleans content on the fly.
Standard Prefix Format
The most common way to interact with the service is via a GET request in any browser or through a programmatic HTTP client. The format is:
https://r.jina.ai/[Full Target URL]
It is crucial to include the protocol (http:// or https://) of the target website to ensure the scraper correctly identifies the destination. If you are accessing the service from within the European Union and require data processing to remain within EU jurisdiction for GDPR compliance, the format shifts slightly to:
https://eu.r.jina.ai/[Full Target URL]
Handling Special Characters in URLs
When the target URL contains query parameters of its own (e.g., https://example.com/search?q=ai&sort=recent), it is generally recommended to URL-encode the target address, especially when using the Reader within a complex script. While the Jina gateway is robust enough to handle many raw strings, encoding prevents ambiguity between the Reader's potential future parameters and the target site's parameters.
Advanced Configuration via Request Headers
While the basic URL format is sufficient for quick tasks, professional-grade implementation often requires fine-tuning. Jina AI Reader does not use complex query strings for configuration; instead, it relies on HTTP headers. This keeps the URL clean and prevents it from hitting character limits in various environments.
Choosing the Right Rendering Engine
In our practical tests with modern web frameworks, we have observed that not all websites are built equal. Some are static HTML, while others are heavy Single Page Applications (SPAs) built with React or Vue.
- Default Engine: Optimized for speed. It works best for blogs, news articles, and documentation.
- Browser Engine: By sending the header
x-engine: browser, you instruct Jina to spin up a headless browser instance. This is essential for websites that require JavaScript execution to render content. In our experience, using the browser engine adds a few seconds of latency but significantly improves content accuracy for dashboard-style sites or pages with dynamic scrolling.
Content Filtering with CSS Selectors
One of the most powerful features for developers is the ability to target or exclude specific parts of a page. This reduces token consumption in LLMs by removing noise.
- Targeting Specific Content: Use
x-target-selectorto provide a CSS selector (like#main-contentor.article-body). The Reader will only return the content within that specific element. - Excluding Clutter: Use
x-remove-selectorto strip out elements like sidebars or footers that the general cleaner might have missed. For instance,x-remove-selector: .related-posts, #commentsis highly effective for cleaning up blog entries before feeding them into a summarizer.
Controlling Output Formats
By default, the service returns Markdown. However, for systems that require structured data, you can set the Accept header to application/json. When this is done, the response body includes not just the content, but also metadata such as the page title, the source URL, and even image descriptions.
Leveraging s.jina.ai for Web Search Integration
Beyond reading specific URLs, Jina provides a search endpoint that follows a similar, intuitive format. This is particularly useful for AI agents that need to browse the web to find information they weren't explicitly given.
The Search URL Format
To perform a web search and get the top results in Markdown, use:
https://s.jina.ai/[Search Query]
For a query like "latest breakthroughs in quantum computing," the URL becomes https://s.jina.ai/latest+breakthroughs+in+quantum+computing.
The response from this endpoint is a concatenated Markdown document containing the top five search results, each clearly delineated. This allows an LLM to "read" the search results page as if it were a high-quality research briefing, rather than a mess of sponsored links and metadata.
Technical Deep Dive into ReaderLM-v2
The secret behind the high quality of r.jina.ai's output is not just a set of regex rules. It is powered by a specialized small language model called ReaderLM-v2.
Why a Specialized Model Matters
Traditional scrapers like BeautifulSoup or Cheerio rely on structural heuristics. They look for <article> tags or large blocks of <p> tags. However, modern web design often hides content in deep nests of <div> tags.
ReaderLM-v2, a 1.5B parameter model, has been trained specifically to understand HTML structures across 29 different languages. It recognizes what constitutes "main content" versus "boilerplate" based on semantic context rather than just tag names. In our benchmarks, this model shows a 20% improvement in accuracy over previous versions, particularly in preserving the hierarchical structure of nested lists and complex tables—elements that often break in traditional scrapers.
Handling Multi-Modal Content
A common frustration with web scraping for LLMs is the loss of visual information. Jina AI Reader solves this by automatically captioning images. When the Reader encounters an image, it utilizes a Vision Language Model (VLM) to generate a descriptive alt-tag.
In the Markdown output, you might see:

This allows a text-only LLM to "understand" the visual evidence presented on a page, significantly reducing hallucinations during summarization tasks.
Practical Implementation for RAG Pipelines
For those building Retrieval-Augmented Generation systems, integrating the r.jina.ai format into your pipeline can be done in just a few lines of code. Below is an analysis of how to optimize this integration.
Efficient Token Management
LLMs have context window limits. Sending a 50KB HTML file is wasteful. Using the Reader API typically reduces the character count by 70-90% by removing code. To further optimize, use the X-Token-Budget header. This tells the Reader to truncate the output to a specific token count, ensuring that you never overflow your LLM's context window during the ingestion phase.
Python Integration Example
While the URL format is simple enough for a browser, programmatic access usually looks like this: