AI Data Formatter & Schema Converter avatar

AI Data Formatter & Schema Converter

Pricing

from $40.00 / 1,000 small data formattings

Go to Apify Store
AI Data Formatter & Schema Converter

AI Data Formatter & Schema Converter

Transform messy CSV or JSON data into a validated custom schema with clean JSON and Excel-ready CSV outputs.

Pricing

from $40.00 / 1,000 small data formattings

Rating

0.0

(0)

Developer

Ezgi Uysal

Ezgi Uysal

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

4 days ago

Last modified

Categories

Share

Transform inconsistent CSV or JSON records into an exact custom schema. The Actor maps semantically equivalent fields, converts safe value types, validates every result, reports records it cannot complete without inventing data, removes duplicates, and returns clean JSON plus an Excel-compatible CSV.

What it does

  • Accepts JSON objects, pasted CSV/JSON, or uploaded CSV/JSON files
  • Maps inconsistent source field names into a user-provided JSON Schema
  • Normalizes whitespace and safely converts numbers, booleans, arrays, and nested objects
  • Validates every successful record against the target schema
  • Marks incomplete records as failed instead of inventing required values
  • Removes duplicates using selected target fields or the complete formatted record
  • Produces dataset rows, full JSON, Excel-ready CSV, and a run summary

The Actor does not scrape third-party websites and has no OCR dependency, which keeps maintenance low.

Input

Use one or more of:

  • records: up to 500 JSON objects
  • files: up to five UTF-8 CSV or JSON uploads
  • dataText: pasted CSV or JSON

targetSchema must describe one JSON object with at least one property. Remote $ref schemas are intentionally disabled so each run remains self-contained and predictable.

{
"records": [
{ "Customer No": "C-001", "Name": " Ada Yilmaz ", "Mail": "ADA@EXAMPLE.COM", "Spent": "1250.50" }
],
"targetSchema": {
"type": "object",
"properties": {
"customer_id": { "type": "string" },
"full_name": { "type": "string" },
"email": { "type": ["string", "null"] },
"total_spent": { "type": ["number", "null"] }
},
"required": ["customer_id", "full_name", "email", "total_spent"],
"additionalProperties": false
},
"instructions": "Normalize email addresses to lowercase.",
"removeDuplicates": true,
"deduplicateBy": ["email"]
}

Use nullable types such as ["string", "null"] when a missing value is acceptable. If a required non-null field cannot be derived from the source, the Actor returns that row with status: "failed" and a clear error.

Output

  • Dataset: one envelope per retained source row with status, the formatted record, warnings, and duplicate metadata
  • OUTPUT.json: target schema, formatted records, batch metadata, and run statistics
  • OUTPUT.csv: UTF-8, Excel-compatible table with dynamic target-schema columns
  • SUMMARY.json: counts, processed size, and metering event

Every model response is validated. Malformed responses, missing source indexes, extra fields, and target-schema mismatches trigger bounded correction retries. Uploaded HTTP files are restricted to public addresses, five redirects, and 15 MB each. Total source text is capped at 500,000 characters.

Environment and local test

Set LLM_API_KEY or OPENAI_API_KEY in the environment. Optional settings are LLM_MODEL, LLM_BASE_URL, and LLM_TIMEOUT_MS.

pnpm install
pnpm test
export LLM_API_KEY="your-key"
export DISABLE_METERING=true
apify run --input-file samples/cloud-input.json

Never put API keys in Actor input or source files. On Apify, keep the key in an encrypted secret and reference it from .actor/actor.json.

Deploy to Apify

apify login
apify push

After deployment, run samples/cloud-input.json. The sample should produce two successful rows, remove one duplicate email, and provide OUTPUT.json, OUTPUT.csv, and SUMMARY.json.

Suggested pay-per-event pricing

EventWorkloadSuggested price
formatter-smallUp to 25 records / equivalent text size$0.04
formatter-medium26–100 records / equivalent text size$0.12
formatter-large101–500 records / equivalent text size$0.45

The workload tier also considers source character count so unusually large records are not underpriced. The event is emitted only after the dataset and downloadable outputs are saved. Review real model costs before changing prices.

Publish in Apify Store

Keep the Actor private while testing. When ready:

  1. Open Actor → Publishing.
  2. Add the Store title and description below.
  3. Select Pay per event.
  4. Add the three exact event names and prices above.
  5. Confirm the default input produces a non-empty dataset.
  6. Publish only after a final successful cloud run.

Suggested Store title: AI Data Formatter & Schema Converter

Suggested description: Transform messy CSV or JSON into any validated target schema with clean JSON, Excel-ready CSV, duplicate removal, and row-level error reporting.