# ZenRows

> Fetch public webpages and check your ZenRows plan usage.

App · 13 actions. Web page: https://docs.lodol.com/docs/integrations/zenrows

## Actions

### Fetch page

Fetch the content of a public webpage.

**Inputs**

- Url (`url`, text, required): Public HTTP or HTTPS URL to fetch.
- Js render (`js_render`, true/false): Wait for the page’s JavaScript to render.
- Wait for (`wait_for`, text): CSS selector to wait for when rendering JavaScript.
- Wait (`wait`, number): Milliseconds to wait after the page loads. From 0 to 30000.
- Css extractor (`css_extractor`, object): Map output field names to CSS selectors.

**Outputs**

- `data` (object): The response from ZenRows.

**Example output**

```json
{
  "data": {
    "content": "example",
    "content_type": "example",
    "request_cost": "example"
  }
}
```

### Get plan usage

Get request limits and credit usage for your ZenRows plan.

**Inputs**: None.

**Outputs**

- `data` (object): The response from ZenRows.

**Example output**

```json
{
  "data": {}
}
```

### List batch jobs

List batch jobs.

**Inputs**

- Status (`status`, text): Status. One of: `open`, `closed`, `deleted`.
- Type (`type`, text): Type. One of: `regular`, `scheduled`.
- Limit (`limit`, number): Page size, 1 to 100 (larger values are treated as 100). Not a positive integer → 400. From 1 to 100.
- Cursor (`cursor`, text): Opaque; echo the previous response's `next_cursor` to continue.

**Outputs**

- `data` (object): The response from ZenRows.

**Example output**

```json
{
  "data": {
    "jobs": [
      {
        "created_at": "example",
        "external_id": "example",
        "format": "html",
        "job_id": "example",
        "latest_run": {
          "created_at": {},
          "failure_detail": {},
          "failure_reason": {},
          "ingest_status": {},
          "job_id": {},
          "last_batch_received": {},
          "pause_state": {},
          "run_id": {},
          "run_sequence": {},
          "stats": {},
          "status": {},
          "trigger": {},
          "updated_at": {}
        },
        "metadata": {},
        "name": "example",
        "next_scheduled_run": "example",
        "schedule": {
          "at": {},
          "calendar": {},
          "rate": {},
          "timezone": {}
        },
        "schedule_state": "active",
        "status": "open",
        "template_tasks": [
          {}
        ],
        "type": "regular",
        "updated_at": "example",
        "webhook": {
          "signature": {},
          "url": {}
        },
        "zenrows_params": {}
      }
    ],
    "next_cursor": "example"
  }
}
```

### List runs of a job (newest first)

List runs of a job (newest first).

**Inputs**

- Job (`job_id`, text, required): Assigned by the server on submit.
- Limit (`limit`, number): Page size, 1 to 100 (larger values are treated as 100). Not a positive integer → 400. From 1 to 100.
- Cursor (`cursor`, text): Cursor.

**Outputs**

- `data` (object): The response from ZenRows.

**Example output**

```json
{
  "data": {
    "next_cursor": "example",
    "runs": [
      {
        "created_at": "example",
        "failure_detail": "example",
        "failure_reason": "insufficient_credits",
        "ingest_status": "pending",
        "job_id": "example",
        "last_batch_received": true,
        "pause_state": "active",
        "run_id": "example",
        "run_sequence": 1,
        "stats": {
          "completed": {},
          "failed": {},
          "failure_reasons": {},
          "spend": {},
          "successful": {},
          "total": {}
        },
        "status": "running",
        "trigger": "manual",
        "updated_at": "example"
      }
    ]
  }
}
```

### List the domains Extract serves

List the domains Extract serves.

**Inputs**: None.

**Outputs**

- `data` (object): The response from ZenRows.

**Example output**

```json
{
  "data": {
    "domains": [
      {
        "domain": "example",
        "verticals": [
          {}
        ],
        "warm": true
      }
    ]
  }
}
```

### List the domains your account submitted

List the domains your account submitted.

**Inputs**: None.

**Outputs**

- `data` (object): The response from ZenRows.

**Example output**

```json
{
  "data": {
    "allowance": {
      "limit": 1,
      "month": "example",
      "remaining": 1,
      "used": 1
    },
    "domains": [
      {
        "domain": "example",
        "failure": {
          "code": {},
          "detail": {},
          "slot_consumed": {}
        },
        "roles": [
          {}
        ],
        "state": "example",
        "status": "preparing",
        "submitted_at": "example",
        "updated_at": "example"
      }
    ]
  }
}
```

### List your crawls

List your crawls.

**Inputs**

- Cursor (`cursor`, text): The `next_cursor` from the previous page.
- Limit (`limit`, number): How many crawls to return. From 1 to 100.

**Outputs**

- `data` (object): The response from ZenRows.

**Example output**

```json
{
  "data": {
    "crawls": [
      {
        "coverage": {
          "items_found": {},
          "pages_failed": {},
          "pages_fetched": {}
        },
        "crawl_id": "example",
        "created_at": "example",
        "depth": 1,
        "discovery": [
          {}
        ],
        "duplicates_removed": 1,
        "error": {
          "code": {},
          "detail": {}
        },
        "exclude_patterns": [
          {}
        ],
        "finished_at": "example",
        "include_patterns": [
          {}
        ],
        "max_items": 1,
        "max_pages": 1,
        "output_format": "html",
        "status": "running",
        "stop_reason": "max_items",
        "url": "example"
      }
    ],
    "next_cursor": "example"
  }
}
```

### Page through per-task results for the latest run of a job

Page through per-task results for the latest run of a job.

**Inputs**

- Job (`job_id`, text, required): Assigned by the server on submit.
- Status (`status`, text): `processing` covers both `pending` and `processing` task. One of: `all`, `successful`, `failed`, `processing`.
- Cursor (`cursor`, text): Opaque pagination token; echo `next_cursor`.

**Outputs**

- `data` (object): The response from ZenRows.

**Example output**

```json
{
  "data": {
    "next_cursor": "example",
    "results": [
      {
        "created_at": "example",
        "error": {
          "code": {},
          "detail": {},
          "instance": {},
          "invalid_tasks": {},
          "status": {},
          "title": {},
          "type": {}
        },
        "external_id": "example",
        "metadata": {},
        "method": "GET",
        "result_url": "example",
        "run_id": "example",
        "source_run_id": "example",
        "spend": {
          "last_attempt": {},
          "total": {}
        },
        "status": "pending",
        "task_id": "example",
        "type": "html",
        "updated_at": "example",
        "url": "example"
      }
    ]
  }
}
```

### Read a crawl and its results

Read a crawl and its results.

**Inputs**

- Crawl (`crawl_id`, text, required): The crawl's ID, as returned when it started.
- Cursor (`cursor`, text): The `next_cursor` from the previous read. Omit it to start from the first result.
- Limit (`limit`, number): How many results to return. From 1 to 10000.

**Outputs**

- `data` (object): The response from ZenRows.

**Example output**

```json
{
  "data": {
    "coverage": {
      "items_found": 1,
      "pages_failed": 1,
      "pages_fetched": 1
    },
    "crawl_id": "example",
    "created_at": "example",
    "depth": 1,
    "discovery": [
      "links"
    ],
    "duplicates_removed": 1,
    "error": {
      "code": "seed_unreachable",
      "detail": "example"
    },
    "exclude_patterns": [
      "example"
    ],
    "finished_at": "example",
    "include_patterns": [
      "example"
    ],
    "max_items": 1,
    "max_pages": 1,
    "next_cursor": "example",
    "output_format": "html",
    "results": [
      {
        "content_status": "pending",
        "content_url": "example",
        "url": "example"
      }
    ],
    "status": "running",
    "stop_reason": "max_items",
    "url": "example"
  }
}
```

### Read a job and its latest run

Read a job and its latest run.

**Inputs**

- Job (`job_id`, text, required): Assigned by the server on submit.

**Outputs**

- `data` (object): The response from ZenRows.

**Example output**

```json
{
  "data": {
    "created_at": "example",
    "external_id": "example",
    "format": "html",
    "job_id": "example",
    "latest_run": {
      "created_at": "example",
      "failure_detail": "example",
      "failure_reason": "insufficient_credits",
      "ingest_status": "pending",
      "job_id": "example",
      "last_batch_received": true,
      "pause_state": "active",
      "run_id": "example",
      "run_sequence": 1,
      "stats": {
        "completed": 1,
        "failed": 1,
        "failure_reasons": {},
        "spend": {
          "cost": {},
          "credits": {}
        },
        "successful": 1,
        "total": 1
      },
      "status": "running",
      "trigger": "manual",
      "updated_at": "example"
    },
    "metadata": {},
    "name": "example",
    "next_scheduled_run": "example",
    "schedule": {
      "at": "example",
      "calendar": {
        "cadence": {
          "daily": {},
          "monthly": {},
          "weekly": {}
        },
        "times_of_day": [
          {}
        ]
      },
      "rate": {
        "every": 1,
        "unit": "minute"
      },
      "timezone": "example"
    },
    "schedule_state": "active",
    "status": "open",
    "template_tasks": [
      {
        "body": {},
        "external_id": "example",
        "metadata": {},
        "method": "GET",
        "url": "example",
        "zenrows_params": {}
      }
    ],
    "type": "regular",
    "updated_at": "example",
    "webhook": {
      "signature": true,
      "url": "example"
    },
    "zenrows_params": {}
  }
}
```

### Read the monthly preparation allowance

Read the monthly preparation allowance.

**Inputs**: None.

**Outputs**

- `data` (object): The response from ZenRows.

**Example output**

```json
{
  "data": {
    "limit": 1,
    "month": "example",
    "remaining": 1,
    "used": 1
  }
}
```

### Start a crawl

Start a crawl.

**Inputs**

- Url (`url`, text, required): The start URL: a public `http` or `https` URL. The crawl starts on this exact URL and stays on its domain, subdomains included.
- Depth (`depth`, number): How many link steps to follow from the start URL. At `1`, the links on the start page. Omit it to follow links until `max_items` or `max_pages` stops the crawl. From 1 to 100000.
- Max items (`max_items`, number): Stop after keeping this many URLs. From 1 to 100000.
- Max pages (`max_pages`, number): Stop after fetching this many pages. Caps what the crawl costs. If both limits are reached together, `stop_reason` is `max_pages`. From 1 to 100000.
- Include patterns (`include_patterns`, list): Keep, and open, only URLs that contain at least one of these texts, such as `/product/`. The start URL is never returned.
- Exclude patterns (`exclude_patterns`, list): Drop URLs that contain any of these texts, even when they match an include pattern.

**Outputs**

- `data` (object): The response from ZenRows.

**Example output**

```json
{
  "data": {
    "coverage": {
      "items_found": 1,
      "pages_failed": 1,
      "pages_fetched": 1
    },
    "crawl_id": "example",
    "created_at": "example",
    "depth": 1,
    "discovery": [
      "links"
    ],
    "duplicates_removed": 1,
    "error": {
      "code": "seed_unreachable",
      "detail": "example"
    },
    "exclude_patterns": [
      "example"
    ],
    "finished_at": "example",
    "include_patterns": [
      "example"
    ],
    "max_items": 1,
    "max_pages": 1,
    "next_cursor": "example",
    "output_format": "html",
    "results": [
      {
        "content_status": "pending",
        "content_url": "example",
        "url": "example"
      }
    ],
    "status": "running",
    "stop_reason": "max_items",
    "url": "example"
  }
}
```

### Track a domain's preparation

Track a domain's preparation.

**Inputs**

- Domain (`domain`, text, required): The domain, without scheme.

**Outputs**

- `data` (object): The response from ZenRows.

**Example output**

```json
{
  "data": {
    "domain": "example",
    "failure": {
      "code": "example",
      "detail": "example",
      "slot_consumed": true
    },
    "roles": [
      {
        "detail": "example",
        "role": "example",
        "status": "example",
        "url": "example"
      }
    ],
    "state": "example",
    "status": "preparing",
    "submitted_at": "example",
    "updated_at": "example"
  }
}
```
