Stream newline-delimited JSON, one object per line
Content type is application/x-ndjson. Swagger UI shows the result only after the stream ends; to watch lines arrive use curl -N "https://api.testingapis.com/api/stream/ndjson/20?intervalMs=200".Content type is application/x-ndjson. Swagger UI shows the result only after the stream ends; to watch lines arrive use curl -N "https://api.testingapis.com…".
Parameters 2
| Name | Type | Description |
|---|---|---|
nrequired | path · integer (int32) | Number of lines (1-1000; out-of-range values are clamped). |
intervalMs | query · integer (int32) | Delay between lines in milliseconds (0-5000, default 0). Default: 0. |
Responses
- 200
- NDJSON lines.
Example
Request
curl -X GET "https://api.testingapis.com/api/stream/ndjson/3" \
-H "X-TestingApis-Key: YOUR_API_KEY"Response200 OK
Content-Type: application/x-ndjson
Cache-Control: no-cache
{"id":1,"name":"Alpha-001","value":3.14,"even":false}
{"id":2,"name":"Bravo-002","value":6.28,"even":true}
{"id":3,"name":"Charlie-003","value":9.42,"even":false}Sign in to see the details
The parameters, request and response examples and the live Try it panel for this endpoint are for signed-in members. Accounts are free and take a few seconds to create.