# Extract structured fields from scraped text with AI

**Use case:** 

Turn messy scraped text (product pages, job posts, listings, bios) into clean columns with your own prompt and JSON schema. Every row returns JSON that matches the schema, so CSV and Excel exports keep the same columns. Estimate the cost before running.

## Input

```json
{
  "rows": [
    {
      "description": "Senior Go developer, fully remote within the EU, 70-85k EUR, Kubernetes and PostgreSQL required."
    }
  ],
  "textField": "description",
  "preset": "custom",
  "prompt": "Extract the job details from the text.",
  "outputSchema": {
    "type": "object",
    "properties": {
      "role": {
        "type": "string"
      },
      "remote": {
        "type": "boolean"
      },
      "salary_min_eur": {
        "type": [
          "number",
          "null"
        ]
      },
      "salary_max_eur": {
        "type": [
          "number",
          "null"
        ]
      },
      "skills": {
        "type": "array",
        "items": {
          "type": "string"
        }
      }
    },
    "required": [
      "role",
      "remote",
      "salary_min_eur",
      "salary_max_eur",
      "skills"
    ]
  },
  "qualityTier": "cheap",
  "maxRows": 1000
}
```

## Output

```json
{
  "ai_status": {
    "label": "Status",
    "format": "text"
  },
  "ai": {
    "label": "AI result",
    "format": "object"
  },
  "ai_meta": {
    "label": "Details",
    "format": "object"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The AI Dataset Enricher – Bulk LLM Prompt on Every Row Actor is ready to run with the inputs already set for "Extract structured fields from scraped text with AI". [Sign up or log in](https://console.apify.com/create-task-from-example/nseNXaLFGHQINLbff) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Extract structured fields from scraped text with AI" task

The AI Dataset Enricher – Bulk LLM Prompt on Every Row Actor will start running based on the input automatically. You can also change all the input fields, like rows (pasted json), text field, and more, to match your specific use case.

### 3. Receive the "Extract structured fields from scraped text with AI" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as status, AI result, and details.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "Extract structured fields from scraped text with AI" task via API](https://apify.com/smoxy/dataset-ai-refinery.md).

## FAQ

### Is the output always valid JSON?

Each row is checked against your schema and retried if needed. A row that still fails is marked invalid_output and is not charged.

### How long can a row be?

Up to about 16,000 input tokens. Rows over 2,000 tokens are charged as long rows; rows over the limit are marked too_long and not charged.

## About this Actor

This example demonstrates how to use [AI Dataset Enricher – Bulk LLM Prompt on Every Row](https://apify.com/smoxy/dataset-ai-refinery.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/smoxy/dataset-ai-refinery.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/smoxy/dataset-ai-refinery.md

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).
