Typical Causes
- Empty response body or file read returned an empty string.
- HTML or text response instead of JSON.
- BOM or invisible control characters at the start.
- JSON string was double-encoded and not decoded first.
Debug Checklist
- Print the raw string length and first 200 characters.
- Validate using JSON Validator.
- If it is escaped, decode with String to JSON.
- Format with JSON Formatter.
Python Example
import json
raw = response.text
print(len(raw), raw[:200])
data = json.loads(raw)Recovery Strategy
Once the payload is valid JSON, compare against a known-good response using JSON Compareto find drift in shape or types.
FAQ
Why does this only happen on some records?
Some rows may be empty or contain stringified JSON. Check for null or empty inputs before parsing.
Should I ignore the error and return null?
Only if the upstream system guarantees optional data. Otherwise, fix the source payload.