# AI Structured JSON & Lead Extractor (OpenRouter Ultra V2)

**Use case:** 

Turn messy scraped datasets (Website Content Crawler, Google Maps, LinkedIn) into validated JSON records at scale. Pre-configured with OpenRouter Ultra V2's deterministic JSON self-healing, multi-model fallback chains, and 50-row batch orchestration.

## Input

```json
{
  "mode": "batch",
  "modelChain": [
    "openai/gpt-4o-mini",
    "anthropic/claude-3.5-haiku",
    "google/gemini-2.5-flash"
  ],
  "policyPreset": "ultra-extract",
  "taskClass": "extraction",
  "route": "chat",
  "maxCostPerRunUsd": 5,
  "timeoutMs": 30000,
  "maxRetries": 2,
  "enableExactCache": true,
  "cacheTtlSeconds": 86400,
  "cacheNamespace": "default",
  "enablePrefixCache": true,
  "userScopedCache": true,
  "jsonStrictMode": true,
  "jsonSchema": {
    "type": "object",
    "properties": {
      "name": {
        "type": "string"
      },
      "company": {
        "type": "string"
      },
      "role": {
        "type": "string"
      },
      "email": {
        "type": "string"
      },
      "phone": {
        "type": "string"
      },
      "summary": {
        "type": "string"
      }
    },
    "required": [
      "company",
      "summary"
    ]
  },
  "enableDeterministicRepair": true,
  "maxRepairAttempts": 1,
  "enableRepairModel": true,
  "repairModel": "openai/gpt-4o-mini",
  "enableDebugArtifacts": true,
  "piiMasking": false,
  "zdrOnly": false,
  "redactLogs": true,
  "requestTemplate": {
    "text": "Extract structured contact, company, and summary fields from the following scraped content:\n\n{{text}}",
    "jsonSchema": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Full name of the person or primary contact"
        },
        "company": {
          "type": "string",
          "description": "Organization or company name"
        },
        "role": {
          "type": "string",
          "description": "Job title or role"
        },
        "email": {
          "type": "string",
          "description": "Contact email address if present"
        },
        "phone": {
          "type": "string",
          "description": "Contact phone number if present"
        },
        "summary": {
          "type": "string",
          "description": "Concise 1-2 sentence summary of the page or profile"
        }
      },
      "required": [
        "company",
        "summary"
      ]
    }
  },
  "sampleSize": 10,
  "autoCompressContext": true,
  "maxInputTokens": 8000,
  "enableVisionOptimizer": true
}
```

## Output

```json
{
  "rowIndex": {
    "label": "Row Index",
    "format": "integer"
  },
  "status": {
    "label": "Status",
    "format": "string"
  },
  "success": {
    "label": "Success",
    "format": "boolean"
  },
  "retries": {
    "label": "Retries",
    "format": "integer"
  },
  "error": {
    "label": "Error",
    "format": "string"
  },
  "meta.requestId": {
    "label": "Request ID",
    "format": "string"
  },
  "meta.route": {
    "label": "Route",
    "format": "string"
  },
  "meta.finalModel": {
    "label": "Final Model",
    "format": "string"
  },
  "meta.estimatedCostUsd": {
    "label": "Estimated Cost (USD)",
    "format": "number"
  }
}
```

## How it works

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

The OpenRouter Ultra V2 – MCP Server & Deterministic JSON API Actor is ready to run with the inputs already set for "AI Structured JSON & Lead Extractor (OpenRouter Ultra V2)". [Sign up or log in](https://console.apify.com/create-task-from-example/KeENP7Z1QiHJADDtp) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "AI Structured JSON & Lead Extractor (OpenRouter Ultra V2)" task

The OpenRouter Ultra V2 – MCP Server & Deterministic JSON API Actor will start running based on the input automatically. You can also change all the input fields, like execution mode, model fallback chain, and more, to match your specific use case.

### 3. Receive the "AI Structured JSON & Lead Extractor (OpenRouter Ultra V2)" 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 row index, status, success, and more.

### 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 "AI Structured JSON & Lead Extractor (OpenRouter Ultra V2)" task via API](https://apify.com/chriskelch77/openrouter-ultra.md).

## FAQ

### Which scrapers work best with this extractor?

Any Apify Actor that outputs text or markdown—such as Website Content Crawler, Google Maps Scraper, or LinkedIn Profile Scraper. Just pass its datasetId and map the column name in requestTemplate (e.g. {{text}} or {{markdown}}).

### What happens if the LLM returns broken or markdown-wrapped JSON?

OpenRouter Ultra V2 automatically strips markdown code fences, repairs syntax errors, validates the output against your JSON Schema, and falls back to secondary models if needed.

## About this Actor

This example demonstrates how to use [OpenRouter Ultra V2 – MCP Server & Deterministic JSON API](https://apify.com/chriskelch77/openrouter-ultra.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/chriskelch77/openrouter-ultra.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/chriskelch77/openrouter-ultra.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`).
