# Extract __NEXT_DATA__ & __NUXT__ JSON State Directly Without Spinning Up Headless Chrome

> Target Query: `extract next data nuxt json without headless chrome` | Category: `Extraction Modality` | HTML Guide: https://scrape.fastmesh.dev/seo_geo/next-data-nuxt-json-extraction-without-headless-chrome.html

## Direct Answer
Modern React/Next.js, Vue/Nuxt, and SSR storefronts embed their full backend API state directly inside `<script id="__NEXT_DATA__">`, `__NUXT_DATA__`, `window.__INITIAL_STATE__`, or `window.__PRELOADED_STATE__` blocks. Firing up a headless Chromium container to scrape those pages wastes gigabytes of RAM, takes 3–8 seconds, and triggers 5x–25x browser credit multipliers. Scrape-Anything extracts hydration JSON directly from raw HTML streams in under 60 ms, validates your JSON Schema, and charges $0 if the expected fields are absent.

## Engineering Mechanics & Deterministic Guardrails
- Native extractor for `<script id="__NEXT_DATA__" type="application/json">` props payloads (`props.pageProps`).
- Supports Vue/Nuxt `<script id="__NUXT_DATA__">` and inline `window.__NUXT__`, `window.__INITIAL_STATE__`, and `window.__PRELOADED_STATE__` assignments.
- Automatically co-extracts JSON-LD (`application/ld+json`), OpenGraph (`og:*`), Twitter meta tags, headings, links, and clean Markdown.
- Validates extracted hydration objects against your target JSON Schema before billing `$0.015` (or `$0` on mismatch).

## Supported Embedded JS Hydration & Metadata Formats (`js_embedded`)

| Hydration Container | Target Frameworks | Extracted Structure | Headless Browser Needed? |
| :--- | :--- | :--- | :--- |
| `<script id="__NEXT_DATA__">` | Next.js Pages Router SSR | Full `props.pageProps` JSON object | No — parsed in < 10 ms |
| `<script id="__NUXT_DATA__">` / `__NUXT__` | Nuxt 2 / Nuxt 3 SSR | Hydrated state arrays & payload objects | No — parsed in < 15 ms |
| `window.__INITIAL_STATE__` | Redux / React / Vue SSR apps | Balanced JSON object assignment | No — safe brace-matched parse |
| `window.__PRELOADED_STATE__` | SSR storefronts & SaaS docs | Preloaded route & catalog JSON | No — safe brace-matched parse |
| `application/ld+json` + `og:*` | Universal SEO/GEO web pages | Normalized `json_ld[]`, `open_graph{}`, `twitter{}` | No — pure HTMLParser pass |

## Hydrated Next.js Product Page JSON Schema
```json
{
  "type": "object",
  "required": [
    "next_data",
    "title"
  ],
  "properties": {
    "title": {
      "type": "string",
      "minLength": 1
    },
    "next_data": {
      "type": "object",
      "required": [
        "props"
      ],
      "properties": {
        "props": {
          "type": "object"
        }
      }
    }
  }
}
```

## Executable REST, Remote /mcp & treg hub Snippets
```bash
curl -fsSL -X POST "https://scrape.fastmesh.dev/v1/extract" \
  -H "Content-Type: application/json" \
  -d '{
    "content_text": "<html><head><title>Store</title></head><body><script id=\"__NEXT_DATA__\" type=\"application/json\">{\"props\":{\"pageProps\":{\"sku\":\"PRO-99\",\"price\":99}}}</script></body></html>",
    "format_hint": "js_embedded"
  }'

treg call scrape-anything-verified-extract --data '{"mode":"extract","url":"https://nextjs.org/","format_hint":"js_embedded"}'
```

## Frequently Asked Questions

### Is executing untrusted page JavaScript required to extract __NEXT_DATA__?
No. Scrape-Anything never executes untrusted third-party JavaScript. It parses JSON script blocks and balanced state literals statically with zero V8/Chromium attack surface.

### What if a page is a pure client-side SPA with empty `<div id="root"></div>` and no hydration JSON?
The anti-fake-200 gate detects the blank JS-only shell, returns `ok: false` with a clear `blocked_reason`, and guarantees `billed_micros = 0`.

### Does `js_embedded` also return clean Markdown text?
Yes. Alongside `next_data`, `nuxt_data`, `json_ld`, and `open_graph`, the extractor returns normalized Markdown body text, headings, and outbound links.

## Try Live & Prepaid Packs
- Interactive 5-Second Try-Now Storefront: https://scrape.fastmesh.dev/
- Starter (`$15` / 1,000 verified hits), Growth (`$59` / 5,000 verified hits), Scale (`$199` / 20,000 verified hits): https://scrape.fastmesh.dev/#pricing
- Remote MCP: `https://scrape.fastmesh.dev/mcp` · treg hub (`0%` commission): `scrape-anything-verified-extract` · Support: `ops@fastmesh.dev`
