Skip to content
looot docs
Esc
↑↓navigate↵open⌘Jpreview
On this page

Olostep / Scrape page with LLM extraction

Olostep tool olostep-scrape-llm on looot: input fields, $0.018 per call, output shape, and code to run it with curl, JavaScript or Python.

This endpoint allows users to start a web page scrape with various configurations.

Inputs

Name Type Required Description
actions array no Actions to perform on the page before getting the content.
country string no Residential country to load the request from. Supported values are: - US (United States) - CA (Canada) - IT (Italy) - IN (India) - GB (England) - JP (Japan) - MX (Mexico) - AU (Australia) - ID (Indonesia) - UA (UAE) - RU (Russia) - RANDOM Some operations, like scraping Google Search and Google News, support all countries.
formats array no Formats in which you want the content.
links_on_page object no With this option, you can get all the links present on the page you scrape. Links are always returned as absolute URLs.
llm_extract object yes
max_age integer no Maximum acceptable age of cached content, in seconds. When a matching scrape already exists and is newer than max_age seconds, Olostep returns the stored result instead of launching a new browser scrape. Defaults to 0 (always scrape fresh). In the dashboard playground, the default is 86400 (24 hours). The maximum allowed value is 604800 (7 days). See the Caching section in the Scrapes feature docs for details.
metadata object no User-defined metadata. Not supported yet
remove_class_names array no List of class names to remove from the content.
remove_css_selectors string no Option to remove certain CSS selectors from the content. Optionally, you can also pass a JSON stringified array of specific selectors you want to remove. The CSS selectors removed when this option is set to default are [‘nav’,‘footer’,‘script’,‘style’,‘noscript’,‘svg’,[role=alert],[role=banner],[role=dialog],[role=alertdialog],[role=region][aria-label*=skip i],[aria-modal=true]]
remove_images boolean no Option to remove images from the scraped content. Defaults to false.
screen_size object no Configuration for screen size. Preset dimensions are available through screen_type: desktop (1920x1080), mobile (414x896), or default (768x1024).
screenshot object no
transformer string no Specify the HTML transformer to use, if any. Postlight’s Mercury Parser library is used to remove ads and other unwanted content from the scraped content.
url_to_scrape string yes The URL to start scraping from.
wait_before_scraping integer no Time to wait in milliseconds before starting the scraping.

Output

The run’s result holds the provider’s answer. Signed in, looot inspect olostep-scrape-llm prints its fields.

Run it

Every call needs your API token in LOOOT_TOKEN; Sign in shows how to get one. Each run also needs a new idempotency key, so a retry never pays twice. With wait: 30 the answer comes back inline when the run ends within 30 seconds. Otherwise you get the running run back: poll GET /v1/runs/<runId>.

Example input with placeholder values:

curl -X POST "https://api.looot.ai/v1/runs" \
  -H "Authorization: Bearer $LOOOT_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"endpointId":"olostep-scrape-llm","input":{"llm_extract":{},"url_to_scrape":"<url_to_scrape>"},"wait":30}'
const response = await fetch("https://api.looot.ai/v1/runs", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.LOOOT_TOKEN}`,
    "Content-Type": "application/json",
    "Idempotency-Key": crypto.randomUUID(),
  },
  body: JSON.stringify({
    endpointId: "olostep-scrape-llm",
    input: {
      llm_extract: {},
      url_to_scrape: "<url_to_scrape>",
    },
    wait: 30,
  }),
});
const run = await response.json();
console.log(run.status, run.result);
import os
import uuid

import requests

response = requests.post(
    "https://api.looot.ai/v1/runs",
    headers={
        "Authorization": f"Bearer {os.environ['LOOOT_TOKEN']}",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "endpointId": "olostep-scrape-llm",
        "input": {
            "llm_extract": {},
            "url_to_scrape": "<url_to_scrape>",
        },
        "wait": 30,
    },
    timeout=90,
)
run = response.json()
print(run["status"], run.get("result"))

To let looot pick among every provider of this job instead, send job:web.scrape.structured as endpointId; see the job page.

Was this page helpful?