Custom JSON Schema Validation
Enforces strict data types (string, integer, boolean, array, nested object) matching your exact target schema.
Structured data extraction API that converts unstructured emails, PDFs, and invoices into validated JSON objects.
https://rsflowhub.com/api/v1/ai/json-extractor
X-API-Key header{
"text": "John is 30 years old and lives in New York. He is a software engineer.",
"schema": {
"name": "string",
"age": "integer",
"city": "string",
"role": "string"
},
"custom_instructions": "Convert all keys to uppercase and output the city name in all-caps."
}
{
"result": {
"extracted_data": {
"invoice_number": "INV-2041",
"vendor": "Acme Supplies",
"total": 1240.5,
"currency": "USD",
"due_date": "2026-11-02"
},
"schema_conforms": true
}
}
Unstructured Text to Structured JSON Extractor API is a REST API on RSFlowHub for web, mobile and AI agent applications. Send a JSON request to POST /api/v1/ai/json-extractor with your API key; RSFlowHub runs it on a tuned AI model, falls back to a backup provider if needed, and returns a structured JSON result, usually within 1 to 3 seconds.
POST /api/v1/ai/json-extractorX-API-Key headerSend these fields as a JSON body. An invalid or missing field returns a 422 error that names the field.
| Field | Type | Required | Description |
|---|---|---|---|
text |
string | Required | The raw unstructured text containing data to be extracted (Max: 20,000 characters). |
schema |
object | Optional | Optional JSON object defining the key-value schema structure to guide the extraction. |
custom_instructions |
string | Optional | Optional text describing custom formatting, filtering, or sanitization rules (Max: 1,000 characters). |
allow_large_text |
boolean | Optional | Optional flag. Set to true to raise the maximum text size limit to 100,000 characters (charges 1 extra credit per 10k characters above 20k). |
Copy, replace rfh_your_api_key with your key and run. Prefer a client library? See the official SDKs.
curl -X POST "https://rsflowhub.com/api/v1/ai/json-extractor" \
-H "Content-Type: application/json" \
-H "X-API-Key: rfh_your_api_key" \
-d '{"text":"John is 30 years old and lives in New York. He is a software engineer.","schema":{"name":"string","age":"integer","city":"string","role":"string"},"custom_instructions":"Convert all keys to uppercase and output the city name in all-caps."}'
<?php
$client = new \GuzzleHttp\Client();
$response = $client->post('https://rsflowhub.com/api/v1/ai/json-extractor', [
'headers' => [
'Content-Type' => 'application/json',
'X-API-Key' => 'rfh_your_api_key',
],
'json' => array (
'text' => 'John is 30 years old and lives in New York. He is a software engineer.',
'schema' =>
array (
'name' => 'string',
'age' => 'integer',
'city' => 'string',
'role' => 'string',
),
'custom_instructions' => 'Convert all keys to uppercase and output the city name in all-caps.',
),
]);
echo $response->getBody();
const response = await fetch('https://rsflowhub.com/api/v1/ai/json-extractor', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'rfh_your_api_key'
},
body: JSON.stringify({"text":"John is 30 years old and lives in New York. He is a software engineer.","schema":{"name":"string","age":"integer","city":"string","role":"string"},"custom_instructions":"Convert all keys to uppercase and output the city name in all-caps."})
});
const data = await response.json();
console.log(data);
import requests
url = "https://rsflowhub.com/api/v1/ai/json-extractor"
headers = {
"Content-Type": "application/json",
"X-API-Key": "rfh_your_api_key"
}
payload = {"text":"John is 30 years old and lives in New York. He is a software engineer.","schema":{"name":"string","age":"integer","city":"string","role":"string"},"custom_instructions":"Convert all keys to uppercase and output the city name in all-caps."}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
Every RSFlowHub endpoint uses the same envelope, so one parser handles all of them. Failed calls are not charged.
{
"success": true,
"request_id": "req_3f9a2c7e-5b1d-4e8a-9c2f-7d6e1a0b4c8d",
"data": {
"result": {
"extracted_data": {
"invoice_number": "INV-2041",
"vendor": "Acme Supplies",
"total": 1240.5,
"currency": "USD",
"due_date": "2026-11-02"
},
"schema_conforms": true
}
},
"meta": {
"version": "v1",
"timestamp": "2026-10-05T09:30:00Z"
}
}
{
"success": false,
"request_id": "req_8c1d4e2a-7f3b-4a9c",
"error": {
"code": "VALIDATION_ERROR",
"message": "The given data was invalid.",
"details": {
"text": [
"This field is required."
]
}
},
"meta": {
"version": "v1",
"timestamp": "2026-10-05T09:30:00Z"
}
}
| Field | Type | Meaning |
|---|---|---|
success | boolean | true when the call worked, false on any error. |
request_id | string | Unique id for this call. Quote it when you contact support. |
data.result | object | The result of this endpoint (see the example). |
error | object | Only on failure: code, message and details per field. |
meta | object | API version and server timestamp. |
All error codes: Errors reference
Enforces strict data types (string, integer, boolean, array, nested object) matching your exact target schema.
Extracts structured records, line item tables, and metadata fields from raw document text dumps.
Supports custom transformation instructions like date normalization, uppercase formatting, or phone cleaning.
Guarantees syntactically valid, parseable JSON output with zero markdown formatting wrappers.
How teams use the Unstructured Text to Structured JSON Extractor API in production.
Extract line items, tax numbers, vendor details, and totals from unstructured invoice emails into accounting software.
{"invoice_id": "1042", "vendor": "Acme Corp", "total": 450.00, "due_date": "2026-09-01"}Turns invoice and receipt text into structured fields instead of manual data entry.
Parse candidate contact details, work experience, education, and skill sets from raw resume text dumps.
{"name": "John Doe", "role": "Senior Software Engineer", "experience_years": 8, "skills": ["PHP", "Laravel", "MySQL"]}Automates candidate profile creation in ATS databases.
Extract tracking numbers, carrier names, and shipping addresses from buyer confirmation emails.
{"order_id": "SHP-9921", "carrier": "FedEx", "tracking_number": "992817261"}Powers automated shipment tracking dashboards.
The same job done three ways.
| Topic | RSFlowHub API | Raw LLM prompts | Rules / regex |
|---|---|---|---|
| Output | Validated JSON fields | Free text you have to parse | Fixed patterns only |
| Setup | One POST request, no prompts | Write and maintain prompts and parsing | Write and maintain rule lists |
| Provider outage | Automatic fallback to a backup model | You build retries and a second vendor | Not applicable |
| Pricing | 2 credits per call, failed calls free | Per token, per vendor | Your own servers and upkeep |
| Understands context | Yes, AI model | Yes, AI model | No, keywords only |
Free plan with 100 credits/month + 1,000 bonus credits when you sign in before 23 Nov. Test it in the playground first, no code needed.
Flowy
AI assistant