Grass
LIVE CONTEXT RETRIEVAL

Overview

Let your agent read webpages without getting blocked. Turn any public URL into structured, LLM-ready data.

POST /contents returns clean, structured content from any URL. It handles JavaScript-rendered pages and complex layouts automatically. Pass in a URL and get back full page content.

Endpoint: POST https://api.lcr.net/contents

Auth: Send your API key as a Bearer token: Authorization: Bearer <api-key>. Get a key at app.lcr.net.

What you get back

Each successful result returns the page as clean text, markdown, and raw html. All three are returned together — there is no format flag to set.

FieldWhat you get
textClean page text. Controlled by text options; omit with text: false.
markdownMarkdown rendering of the page.
htmlThe raw crawled HTML.

Every field is truncated to 20,000 characters by default. Raise the limit with text: { maxCharacters: 200000 }, and pass text: { verbosity: "full" } for the whole <body> instead of just the main content.

{
  "urls": ["https://example.com"],
  "text": { "verbosity": "full", "maxCharacters": 200000 }
}

See Output size & truncation for details, including how caching affects the size you get back.

Content freshness

Controls whether content is served from cache, fetched live, or both. Cached content is stored for up to 7 days.

ValueBehavior
Omit (default)Serve from cache if any cached entry exists for the URL, regardless of age. Livecrawl only when no cache entry exists. Recommended for most use cases.
Positive (e.g. 24)Serve from cache if the cached entry is less than N hours old. Livecrawl if the cache is older than N hours or missing.
0Always livecrawl. Cache is never read. Guarantees the freshest possible content at the cost of higher latency.
-1Never livecrawl. Return cached content only. If no cache entry exists, returns a CRAWL_NOT_FOUND error. Fastest possible response.

Livecrawl failure fallback

If a livecrawl fails or times out and a cached entry exists for the URL (regardless of age), the cached entry is returned as a best-effort response. The status entry will reflect "source": "cached-fallback" so you can detect this case. This fallback does not apply when maxAgeHours is 0 (cache is explicitly disabled).

Cache writes on maxAgeHours: 0

Even when maxAgeHours is 0, a successful livecrawl result is still written to cache. The 0 value only disables cache reads. A later request with a positive or omitted maxAgeHours can reuse that crawl.

When using maxAgeHours, pair it with livecrawlTimeout (10000–15000ms recommended).

See examples for freshness request patterns.

Minimal working example

curl --location 'https://api.lcr.net/contents' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --data '{
    "urls": ["https://grass.io"],
    "text": true
  }'

Python, Node.js, Go, and PHP versions are on the Code Examples page.

Geotargeting

Use countryCode to route crawls through a proxy for a specific country. This is useful when websites serve different content based on the visitor's location.

Pass a two-letter ISO 3166-1 alpha-2 country code. Values are lowercased and trimmed, and uk is accepted as an alias for gb. If omitted, requests route through the us default.

{
  "urls": ["https://example.com"],
  "text": true,
  "countryCode": "us"
}

Match the code to the site. Many sites serve different content per country — prices, currency, language, and availability can all change based on where the request comes from. When the URL is already country-specific, set countryCode to that same country so you get the localized page instead of the default US version.

For example, ph.shein.com is the Philippine storefront, so crawl it with "countryCode": "ph":

{
  "urls": ["https://ph.shein.com/"],
  "text": true,
  "countryCode": "ph"
}

With the default us, the same URL can return the US storefront — different products, USD prices, and US-English copy.

Geotargeting can be combined with freshness and output size settings. For example, to fetch the US version of a page using content cached within the last 24 hours:

{
  "urls": ["https://example.com"],
  "text": true,
  "countryCode": "us",
  "maxAgeHours": 24
}

Credits

When you subscribe to a plan, you receive a monthly credit allowance that covers your API requests. If you go over your monthly plan you have the option to top off credits based on the Subscription level.

Unused subscription credits will expire at the end of each billing cycle. Top off credits never expire and will carry over from month to month.

Subscription Levels

PlanMonthly Credits
Starter90,000
Developer500,000
Business1,000,000
Enterprise3,000,000
CustomTailored to your needs

How Credits Work

Credit consumption depends on the technical complexity of the target web page:

Page TypeStrategyDescriptionCost
Static / SSRfast, tlsServer-side rendered HTML (no JavaScript rendering required)1 credit
JavaScript RenderedbrowserPages requiring client-side JavaScript execution2 credits
Complex Pageslocal-browserPlaywright required Anti-bot protections, heavy rendering, or custom bypass requirements3 credits
ErroranyUnable to parse the page0 credits

Automatic Optimization
You don't need to choose a rendering mode manually. Our internal routing engine automatically tests target sites to find the fastest, lowest-cost parsing method—and reuses that configuration for all subsequent requests to that domain.

Restricted Targets & Prohibited Content

To comply with regulatory standards and legal obligations, our scraping infrastructure automatically blocks access to specific domain categories.

Enforcement Notice:
Requests directed at prohibited targets are rejected immediately and will not consume your API credits. However, excessive attempts to scrape restricted websites will result in automatic account suspension. Re-enabling a suspended account requires review by Customer Support.

On this page