API Acre · Data Schema

by API Acre

POSTBaseSolana

$0.025

per call · USD Coin on Base

Create and generate a nested JSON Schema Draft 2020-12 contract by inferring field types and required fields from representative JSON, CSV, TSV, JSON Lines, or YAML records, with equivalent CSV/TSV numeric and null inference, input evidence, and non-enforcing observed bounds.

Endpoint

POST https://apiacre.com/v1/data/schema

5

Calls / 30d

4

Unique payers / 30d

Aug 31

Last called

exact

Payment scheme

Call this service

TypeScript · @x402/fetch
import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.PRIVATE_KEY);
const fetchWithPay = wrapFetchWithPayment(fetch, account);

const res = await fetchWithPay("https://apiacre.com/v1/data/schema", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "content": "[{\"name\":\"Ada\",\"score\":98}]",
    "format": "json",
    "root_mode": "records"
  }),
});
const data = await res.json();
cURL
curl -X POST \
  "https://apiacre.com/v1/data/schema" \
  -H "Content-Type: application/json" \
  -d '{"content":"[{\"name\":\"Ada\",\"score\":98}]","format":"json","root_mode":"records"}' \
  -H "X-PAYMENT: <signed x402 payment>"

Example response

{
  "data": {
    "inference": {
      "csvEmptyStringsAsNull": false,
      "csvNumericStringsCoerced": false,
      "dialect": "https://json-schema.org/draft/2020-12/schema",
      "tabularNumericStringsCoerced": false,
      "version": "apiacre-schema-inference/3"
    },
    "input": {
      "characters": 27,
      "format": "json",
      "records": 1,
      "rootMode": "records",
      "utf8Bytes": 27
    },
    "schema": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "items": {
        "properties": {
          "name": {
            "type": "string",
            "x-apiacre-observed": {
              "missingCount": 0,
              "nullCount": 0,
              "presentCount": 1,
              "sampleCount": 1,
              "types": [
                "string"
              ]
            }
          },
          "score": {
            "type": "integer",
            "x-apiacre-observed": {
              "missingCount": 0,
              "nullCount": 0,
              "presentCount": 1,
              "sampleCount": 1,
              "types": [
                "integer"
              ]
            }
          }
        },
        "required": [
          "name",
          "score"
        ],
        "type": "object",
        "x-apiacre-observed": {
          "missingCount": 0,
          "nullCount": 0,
          "presentCount": 1,
          "sampleCount": 1,
          "types": [
            "object"
          ]
        }
      },
      "type": "array",
      "x-apiacre-observed": {
        "missingCount": 0,
        "nullCount": 0,
        "presentCount": 1,
        "sampleCount": 1,
        "types": [
          "array"
        ]
      }
    }
  },
  "meta": {
    "cached": false,
    "duration_ms": 42,
    "next_actions": [
      {
        "method": "POST",
        "path": "/v1/data/schema-validate",
        "reason": "Validate a future JSON value against the inferred Draft 2020-12 contract.",
        "service": "data.schema-validate",
        "title": "JSON Schema validation"
      }
    ],
    "sources": [],
    "warnings": []
  },
  "request_id": "018f1f54-7f38-7ba2-8dc3-5f90272d9f1a",
  "service": "data.schema",
  "version": "1"
}

Payment details

Pay to0xa0bfa4f07281c9b248dc3aed2217836bca24869b
AssetUSD Coin · 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
NetworksBase, Solana
Schemesexact

Is this your API?

Pin it to the top of Data & Enrichment and the homepage with a featured placement.

Get featured →

More from API Acre & similar services