Skip to main content

NDJSON Response Format

The JSON format for crawlrun results is NDJSON.

Content-type: application/x-ndjson

The following shows an example of a typical JSON response:

{ "name": "John", "age": 30, "city": "New York" }
{ "name": "Jane", "age": 25, "city": "San Francisco" }
{ "name": "Joe", "age": 40, "city": "Los Angeles" }

So each line is a valid JSON object, but the whole file is not a valid JSON file. You have to read it line by line, and parse each line separately, to get the JSON object from it. Or alternatively read the whole file and split it by newline character, and then parse each line separately.