Skip to main content

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

MicroSkills Reference

Sample Rows

data.sample_rows

ProductionBounded custom (Class B)Deterministicverifiablefastv1.0.0
File inputNo network

Overview

When you send JSON rows or a CSV file reference, we return a deterministic sample using first, last, systematic, content-hash, seeded-random, or stratified methods. The same seed and input always yield the same rows — we never use runtime randomness. Do not use this for statistically rigorous survey sampling.

Reproducible sampling is essential for debugging and audits — you need the same rows every time, not a different draw on each call.

Reliability

There is no randomness here at all: the same dataset, method and seed always return exactly the same rows, whatever machine or day you run on. hash ranks every row by a SHA-256 digest of its content and keeps the lowest ones, so it follows the data and ignores the seed — two datasets sharing a row will sample that row alike. seeded_random digests the seed together with each row's position and content, so a new seed gives a different draw you can still reproduce. Ties break on the original position, and stratified fills each group's quota from its earliest rows. None of these refusals is worth retrying unchanged: sending both rows and fileRef or neither, choosing stratified without stratifyBy, pointing fileRef at anything but CSV, and a dataset over 100,000 rows.

Context footprint

Returns sample, inputRowCount, sampleRowCount, method, and seed. A successful call costs 1 execution credit.

When to use it

When you want a bounded, deterministic subset with a known method and seed.

When you need rigorous statistical inference or weighted population sampling.

Scope

Note
Produces a reproducible subset of dataset rows.

Non-goals

  • Does not use runtime randomness
  • Does not modify the source dataset
  • Does not guarantee statistical representativeness

Properties

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

data-transformation

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call1 credit

File handling

Accepts file_refProduces file_refMax input2 MBMax file size9.5 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 file9.5 MiBSkill and platform maximum

How we handle your data

Sensitive output possible
What this means

This skill may receive sensitive content and may return submitted, transformed, extracted, or reformatted content.

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 may contain submitted or transformed 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
rowsarrayNoBounded array of 0 through 100000 input row objects keyed by column name; omit it when fileRef is the source.
fileRefstringNoTenant-scoped uploaded CSV reference. Omit it to use the required inline rows; never send both.
methodstringNoSampling method; omit it for first.
formatstringNoFile format when fileRef is used; omit it for csv.
hasHeaderbooleanNoWhether the CSV first line names columns; omit it for true.
sampleSizeintegerNoHow many rows to return; omit it for 100.
seedstringNoSeed used by seeded_random; omit it for squillify.
stratifyBystringNoColumn that defines stratified groups; required unless method is not stratified.
includeRowNumbersbooleanNoWhether _rowNumber is added; omit it for true.
orderBySampleKeybooleanNoWhether hash or seeded_random results are returned in digest order; omit it for false.

Output schema

FieldTypeRequiredDescription
samplearrayYesBounded array of 0 through 100000 input row objects keyed by column name, where missing keys count as null.
inputRowCountintegerYesHow many rows the dataset held before sampling.
sampleRowCountintegerYesHow many rows came back, at most sampleSize.
methodstringYesSampling method actually applied.
seedstringYesSeed actually used, including the default squillify.

API contract

POST /v1/execute
curl
curl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"data.sample_rows","input":{"rows":[{"id":1,"name":"Alice"}],"sampleSize":1,"method":"first"}}'
Integrations
TypeScript SDK
import { Squillify } from "@squillify/sdk";

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

const { output } = await sq.execute("data.sample_rows", {"rows":[{"id":1,"name":"Alice"}],"sampleSize":1,"method":"first"});

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 use runtime randomness
  • Does not modify the source dataset
  • Does not guarantee statistical representativeness
  • Statistically rigorous survey sampling
  • Unbounded streaming samples

How to call

POST /v1/execute (requires authentication)

Request bodyjson
{
  "skillKey": "data.sample_rows",
  "input": {
    "rows": [
      {
        "id": 1,
        "name": "Alice"
      }
    ],
    "sampleSize": 1,
    "method": "first"
  }
}

Examples

First row with row number metadata

Inputjson
{
  "rows": [
    {
      "id": 1,
      "name": "Alice"
    }
  ],
  "sampleSize": 1,
  "method": "first"
}
Expected outputjson
{
  "method": "first",
  "sample": [
    {
      "name": "Alice",
      "_rowNumber": 1,
      "id": 1
    }
  ],
  "seed": "squillify",
  "sampleRowCount": 1,
  "inputRowCount": 1
}

Hash-based sample with custom seed

Inputjson
{
  "seed": "audit-2026",
  "rows": [
    {
      "id": 1
    },
    {
      "id": 2
    },
    {
      "id": 3
    }
  ],
  "method": "hash",
  "sampleSize": 2
}
Expected outputjson
{
  "method": "hash",
  "sample": [
    {
      "id": 1,
      "_rowNumber": 1
    },
    {
      "id": 2,
      "_rowNumber": 2
    }
  ],
  "seed": "audit-2026",
  "sampleRowCount": 2,
  "inputRowCount": 3
}
  • Debugging with a fixed subset
  • Audit trails with seeded selection
  • Preview a dataset before heavier processing

Avoid for

  • Statistically rigorous survey sampling
  • Unbounded streaming samples

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

transformationstatisticsdata