{"id":8408,"date":"2026-01-27T15:50:29","date_gmt":"2026-01-27T20:50:29","guid":{"rendered":"https:\/\/frontendmasters.com\/blog\/?p=8408"},"modified":"2026-01-27T15:50:30","modified_gmt":"2026-01-27T20:50:30","slug":"streaming-json-in-just-200-lines-of-javascript","status":"publish","type":"post","link":"https:\/\/frontendmasters.com\/blog\/streaming-json-in-just-200-lines-of-javascript\/","title":{"rendered":"Streaming JSON in just 200 lines of JavaScript"},"content":{"rendered":"\n<p>I feel like &#8220;streaming&#8221; will be more and more of a concept in 2026. We <em>can<\/em> <a href=\"https:\/\/frontendmasters.com\/blog\/streaming-html\/\">stream HTML<\/a>, but rarely do. With AI APIs these days, we&#8217;re seeing streaming much more commonly. We want to see that LLM kick out an answer word-by-word, as the perceived performance is better that way. What about a JSON response, can we stream that? Seems harder since JSON needs to be fully valid to be decoded. <a href=\"https:\/\/krasimirtsonev.com\/blog\/article\/streaming-json-in-just-200-lines-of-javascript\">Krasimir Tsonev shows how it can be done<\/a>. <\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I feel like &#8220;streaming&#8221; will be more and more of a concept in 2026. We can stream HTML, but rarely do. With AI APIs these days, we&#8217;re seeing streaming much more commonly. We want to see that LLM kick out an answer word-by-word, as the perceived performance is better that way. What about a JSON [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":8409,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"sig_custom_text":"","sig_image_type":"featured-image","sig_custom_image":0,"sig_is_disabled":false,"inline_featured_image":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[29],"tags":[290,3,76,442],"class_list":["post-8408","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-the-beat","tag-api","tag-javascript","tag-json","tag-streaming"],"acf":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/01\/streamson.jpg?fit=500%2C500&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/8408","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/comments?post=8408"}],"version-history":[{"count":1,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/8408\/revisions"}],"predecessor-version":[{"id":8410,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/8408\/revisions\/8410"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/media\/8409"}],"wp:attachment":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/media?parent=8408"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/categories?post=8408"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/tags?post=8408"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}