# Parsera (`parsera-labs/parsera`) Actor

Extract data from any website using just a URL and column descriptions

- **URL**: https://apify.com/parsera-labs/parsera.md
- **Developed by:** [Parsera Labs](https://apify.com/parsera-labs) (community)
- **Categories:** AI, Agents, Developer tools
- **Stats:** 622 total users, 5 monthly users, 100.0% runs succeeded, 13 bookmarks
- **User rating**: 2.02 out of 5 stars

## Pricing

Pay per event

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

<a href="https://apify.com/parsera-labs/parsera?fpr=czveg"><img src="https://apify.com/ext/run-on-apify.png" alt="Run Parsera Actor on Apify" width="126" height="28" /></a>

## Parsera Actor

- Extract structured data from any website using [Parsera's](https://parsera.org) AI-powered data extraction API.
- PS: Check out our AI Scraping Agents at Parsera.org! They extract data from URLs and HTML by generating scraping scripts and automatically adapting to changes on the data source side.

### Example

Input url you want to scrape in `Basic Configuration` > `Target URL`, and list columns to extract in `Extraction Settings` > `Extraction Attributes`.
For example, you can extract list of articles from `https://news.ycombinator.com/` by putting this value into `Target URL` and filling `Extraction Attributes` with:

```json
[
    {
        "description": "News title",
        "name": "title"
    },
    {
        "description": "Number of points",
        "name": "points"
    },
    {
        "description": "Number of comments",
        "name": "nr_comments"
    }
]
```

At end you'll get a table that looks like this:
| nr\_comments | points | title |
|-------|------|----------|
| 11 | 41 | The Inevitability of the Borrow Checker |
| 1 | 19 | When Louis Armstrong Conquered Chicago |
| 448 | 689 | Meta torrented & seeded 81.7 TB dataset containing copyrighted data |
| ... | ... | ... |

### 📝 Input Configuration

The actor accepts the following input parameters:

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `url` | String | Yes | The target URL to extract data from |
| `attributes` | Array | Yes | List of data attributes to extract |
| `proxyCountry` | String | No | Country for proxy IP (defaults to United States) |
| `cookies` | Array | No | Cookies to inject into the request |
| `precisionMode` | Boolean | No | Enable high-precision extraction mode |

#### Attributes Structure

Each attribute in the `attributes` array should have:

- `name`: Identifier for the extracted data
- `description`: Natural language description of what to extract

### 💡 Tips

- Use precise, detailed descriptions in your attributes for better extraction accuracy
- Enable `precisionMode` for highest accuracy (uses more credits)
- Test your extraction pattern on a few pages before running large-scale scrapes
- The speed of the response depends mainly on the LLM output so if you're collecting a lot of data, the response time will increase. We're working on a code generation sytem to provide back data instantly, so stay tuned and sign up for news at https://parsera.org!

### 📊 Usage Limits

- Each successful extraction consumes 1 Parsera credit (10 credits with `precisionMode`)
- Check your credit balance at [parsera.org/dashboard](https://parsera.org/app)
- Need more credits? Visit [parsera.org/pricing](https://parsera.org/pricing)

### 🤝 Support

- Documentation: [docs.parsera.org](https://docs.parsera.org)
- Email: <contact@parsera.org>
- Discord: [Join our community](https://discord.gg/parsera)

# Actor input Schema

## `url` (type: `string`):

The webpage URL to extract data from

## `attributes` (type: `array`):

Define what data to extract from the webpage

## `precisionMode` (type: `boolean`):

Enable for more accurate but more expensive extraction

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

Country for the proxy IP (optional)

## `cookies` (type: `array`):

Custom cookies to use for the request (optional)

## Actor input object example

```json
{
  "url": "https://news.ycombinator.com/",
  "attributes": [
    {
      "description": "News title",
      "name": "title"
    },
    {
      "description": "Number of points",
      "name": "points"
    },
    {
      "description": "Number of comments",
      "name": "comments"
    }
  ],
  "precisionMode": false
}
```

# 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 = {
    "url": "https://news.ycombinator.com/",
    "attributes": [
        {
            "description": "News title",
            "name": "title"
        },
        {
            "description": "Number of points",
            "name": "points"
        },
        {
            "description": "Number of comments",
            "name": "comments"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("parsera-labs/parsera").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 = {
    "url": "https://news.ycombinator.com/",
    "attributes": [
        {
            "description": "News title",
            "name": "title",
        },
        {
            "description": "Number of points",
            "name": "points",
        },
        {
            "description": "Number of comments",
            "name": "comments",
        },
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("parsera-labs/parsera").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "url": "https://news.ycombinator.com/",
  "attributes": [
    {
      "description": "News title",
      "name": "title"
    },
    {
      "description": "Number of points",
      "name": "points"
    },
    {
      "description": "Number of comments",
      "name": "comments"
    }
  ]
}' |
apify call parsera-labs/parsera --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=parsera-labs/parsera",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/lMdYYV23WdnyG0cAu/builds/1vdz3dsW7oFZPFDM6/openapi.json
