Skip to content

JSON Data Profiler API

Overview

Profiles JSON structure and values, reporting type counts, depth, nulls, common keys, and numeric, string, and array statistics.

Endpoint

POST https://api.apidatatools.com/json-data-profiler-api

Authentication and input modes

Include x-api-key: YOUR_API_KEY. Supports body (default), url, and file; URL and file modes are asynchronous. Accepted extensions are .txt, .json, and .log.

curl example

curl -X POST 'https://api.apidatatools.com/json-data-profiler-api' \\
  -H 'x-api-key: YOUR_API_KEY' \\
  --data-raw '{"users":[{"age":30,"name":"Ada"},{"age":40,"name":null}]}'

Result

The report includes total_values, max_depth, types, null_values, unique_keys, and up to 100 entries in key_frequency. When applicable, it also includes min, max, and average statistics in string_lengths, array_lengths, and numbers.

URL and file modes

curl --request POST --url https://api.apidatatools.com/json-data-profiler-api \
  --header 'x-api-key: YOUR_API_KEY' --header 'x-source-type: url' \
  --header 'Content-Type: application/json' --data '{"url":"https://example.com/input.json"}'
curl --request POST --url https://api.apidatatools.com/json-data-profiler-api \
  --header 'x-api-key: YOUR_API_KEY' --header 'x-source-type: file' \
  --header 'Content-Type: application/json' --data '{"file":"S3_KEY_RETURNED_BY_THE_UPLOAD_WORKFLOW"}'

Success and async process

Body mode returns HTTP 200 with the report's temporary file URL and preview. URL/file mode returns HTTP 202:

{"status":"accepted","job_id":"JOB_ID","status_url":"https://api.apidatatools.com/jobs/JOB_ID","request_id":"REQUEST_ID"}

Poll the status URL with x-api-key. Queued/processing responses include Unix timestamps, message, and retry_after. Success includes result.file and result.preview; failure includes error.code, message, and details.

Error handling

HTTP status Error codes
400 INVALID_SOURCE_TYPE, INVALID_BODY_ENCODING, EMPTY_BODY, INVALID_JSON, INVALID_JSON_ENCODING, JSON_TOO_DEEP
401 UNAUTHORIZED
404 USER_NOT_FOUND, UNKNOWN_FUNCTION
413 PAYLOAD_TOO_LARGE
429 QUOTA_EXCEEDED, RATE_LIMITED
500 PLAN_NOT_FOUND, AUTH_ERROR, INTERNAL_ERROR

Async submission errors include URL/file validation errors, FILE_TOO_LARGE, CONFIG_ERROR, and PLAN_CONFIG_ERROR. Worker/status errors include DOWNLOAD_FAILED, UPLOAD_FAILED, INVALID_JOB_ID, JOB_NOT_FOUND, FORBIDDEN, and DDB_ERROR.

Notes

Honor retry_after. Output URLs expire according to your plan retention period.