Skip to main content

Squillify development is paused indefinitely. Read why, and discover what this experiment achieved. Read the story

MicroSkills Reference

Extract JSON-LD

web.extract_json_ld

ProductionEngine wrapper (Class A)Deterministicverifiablefastv1.0.0
File inputNo network

Overview

You send HTML you already have and we find every <script type="application/ld+json"> block in it, check each one parses as JSON, hand back the parsed content, and surface the @type it declares. No script ever runs and nothing is fetched, so a hostile page cannot make us do anything. This is extraction rather than schema.org review, which web.validate_json_ld covers. Accepts file input via file_ref — no need to extract file content first.

Fishing script blocks out with a regular expression breaks on real pages, and you want the content read without a browser anywhere near it.

Reliability

Same markup and same options always give the same answer, and nothing leaves the platform. Two behaviours often surprise people: a block that fails to parse is reported in errors and still returned, so a broken page never fails the whole call; and turning off both validateJson and compact means we never parse at all, so validJson comes back true and type comes back null for every block. Blocks past maxBlocks are dropped with a warning rather than an error. Bad input is rejected outright and retrying will not help — sending neither html nor file_ref, a file reference we cannot read for you, maxBlocks outside 1 to 10000, or content beyond 2097152 bytes.

Context footprint

Each block's parsed content comes back in full, so a page with large product feeds returns a lot — set compact to false, or lower maxBlocks, to shrink it. A successful call costs 1 execution credit.

When to use it

When you hold some HTML and want its structured-data blocks, parsed and listed.

When the page still needs fetching, when a remote @context has to be resolved, or when you need schema.org rules applied to the result.

Runs on jsoup for the markup and Jackson for the JSON inside each block.

Scope

Note
We pull the JSON-LD blocks out of HTML you hold and tell you which of them parse.

Non-goals

  • Does not run any script on the page
  • Does not fetch the page, or resolve the @context it points at
  • Does not check schema.org rules, which web.validate_json_ld does
  • Does not merge, reshape, or deduplicate the blocks it finds

Properties

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

analysisparsing

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call1 credit

File handling

Accepts file_refProduces file_refMax input2 MBMax file size2 MB

File limits

Constraints this skill applies to your input and generated files. The “Limited by” column shows the static source of each cap; none of these can be raised by upgrading your plan.

LimitValueLimited by
Maximum size per input file2 MiBSkill maximum

How we handle your data

Sensitive input, safe output
What this means

This skill may receive sensitive content, but it does not target sensitive data and returns only a structured non-sensitive result.

Squillify guarantees
  • Runs inside Squillify
  • This skill runs inside Squillify.
  • Payloads are not sent to an external service by this skill.
  • Squillify does not permanently store submitted payloads.
  • Telemetry records metadata only, not submitted content.
  • Submitted payloads are not used for training.
  • Submitted payloads are not reviewed by humans.
  • This skill does not target sensitive data.
  • The response does not contain submitted content.
Your responsibility

Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.

Read the Microskill Data Handling Policy

Input schema

FieldTypeRequiredDescription
htmlstringNoBounded inline source. Required unless file_ref is provided.
file_refstringNoTenant-scoped opaque file reference. Omit it when inline source is supplied.
baseUrlstringNoOptional absolute base URL for relative identifiers; omit it to preserve relative values.
validateJsonbooleanNoWhether malformed JSON blocks become errors; omit it for true.
compactbooleanNoWhether parsed blocks are compacted; omit it for false.
maxBlocksintegerNoBlock cap; omit it for one hundred.

Output schema

FieldTypeRequiredDescription
blocksarrayYesBounded array of parsed JSON-LD block receipts in document order. The item shape is defined by the nested schema and the array contains from 0 through 10000 items.
blockCountintegerYesReturned JSON-LD block count.
errorsarrayYesBounded array of malformed-block error strings. The item shape is defined by the nested schema and the array contains from 0 through 20000 items.
warningsarrayNoBounded array of non-fatal safe warning strings. The item shape is defined by the nested schema and the array contains from 0 through 20000 items.

API contract

POST /v1/execute
curl
curl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"web.extract_json_ld","input":{"html":"<script type=\"application/ld+json\">{}</script>"}}'
Integrations
TypeScript SDK
import { Squillify } from "@squillify/sdk";

const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });

const { output } = await sq.execute("web.extract_json_ld", {"html":"<script type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"Organization\",\"name\":\"Acme\"}</script>"});

Errors

CodeHTTPRetryableDescription
VALIDATION_ERROR400NoThe request payload failed schema validation.
UNAUTHORIZED401NoMissing or invalid API key.
SKILL_NOT_ACCESSIBLE403NoThe API key is not granted access to this skill.
SKILL_NOT_AVAILABLE_FOR_PLAN403NoThis skill is not included in your current plan.
PLAN_ELIGIBILITY_UNAVAILABLE503YesPlan eligibility could not be decided. Retry after backoff.
SKILL_NOT_FOUND404NoThe requested skill or version does not exist.
TENANT_RATE_LIMITED429YesRequest rate limit exceeded. Retry after backoff.
QUOTA_EXCEEDED429YesPlan quota exhausted. Retryable once the quota period resets.
EXECUTION_TIMEOUT504YesExecution exceeded the allowed time budget.

Other limits

LimitValue
Recommended inline bytes32 KiB

Limitations

  • Does not run any script on the page
  • Does not fetch the page, or resolve the @context it points at
  • Does not check schema.org rules, which web.validate_json_ld does
  • Does not merge, reshape, or deduplicate the blocks it finds
  • Fetching the page — bring the markup with you
  • Judging whether the structured data satisfies schema.org

How to call

POST /v1/execute (requires authentication)

Request bodyjson
{
  "skillKey": "web.extract_json_ld",
  "input": {
    "html": "<script type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"Organization\",\"name\":\"Acme\"}</script>"
  }
}

Examples

One Organization block extracted

Inputjson
{
  "html": "<script type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"Organization\",\"name\":\"Acme\"}</script>"
}
Expected outputjson
{
  "blocks": [
    {
      "index": 0,
      "validJson": true,
      "rawLength": 70,
      "type": "Organization",
      "json": {
        "name": "Acme",
        "@type": "Organization",
        "@context": "https://schema.org"
      }
    }
  ],
  "warnings": [],
  "blockCount": 1,
  "errors": []
}

Malformed block reported without failing the call

Inputjson
{
  "validateJson": true,
  "html": "<script type=\"application/ld+json\">{not json}</script>"
}
Expected outputjson
{
  "blocks": [
    {
      "index": 0,
      "rawLength": 10,
      "validJson": false,
      "type": null
    }
  ],
  "warnings": [],
  "blockCount": 1,
  "errors": [
    "Block 0 is not valid JSON."
  ]
}
  • Pull the structured data out of a page you have already saved
  • Audit schema.org markup before you publish it
  • Feed the blocks you find into web.validate_json_ld

Avoid for

  • Fetching the page — bring the markup with you
  • Judging whether the structured data satisfies schema.org

Composable with

Safety & privacy

  • Runs without calling any external service.
  • Your payloads are never stored permanently.
  • Telemetry captures metadata only — never your payload contents.
  • We never train models on your payloads.
  • No human reviews your payloads.

Tags

webseojsonhtml