online / endpoints 59 / categories 14 / rate 60/min/ip /

GET /json-feed

GET /json-feed

Returns JSON Feed 1.1 documents with semantic violations that parse as valid JSON but break spec compliance. Default sends a bare version string instead of the required URL. Use ?mode= to isolate other violations.

mode Which violation to send. One of: version-mismatch (default; `version` is "1.1" instead of the full URL "https://jsonfeed.org/version/1.1"), items-id-not-unique (two items share the same `id`), item-url-malformed (an item `url` is a relative path instead of an absolute URL), feed-url-wrong (`feed_url` points to a different domain).

control Compare against the well-formed counterpart: not.catastrophic.io/json-feed side-by-side

build a request:

expect: A JSON Feed document served as application/feed+json with one of four spec violations. The `note` field in the body explains what is wrong.

bash
curl -si 'https://chaos.catastrophic.io/json-feed?mode=version-mismatch' | grep -E '^(HTTP|content-type|x-chaos)'
import urllib.request, json
resp = urllib.request.urlopen("https://chaos.catastrophic.io/json-feed?mode=version-mismatch")
print("Content-Type:", resp.headers.get("Content-Type"))
print("X-Chaos-Json-Feed-Mode:", resp.headers.get("X-Chaos-Json-Feed-Mode"))
body = json.loads(resp.read())
print("version:", body.get("version"))
print("feed_url:", body.get("feed_url"))
ids = [it.get("id") for it in body.get("items", [])]
print("item ids:", ids)
print("ids unique:", len(ids) == len(set(ids)))
print("note:", body.get("note"))
const res = await fetch("https://chaos.catastrophic.io/json-feed?mode=version-mismatch");
const body = await res.json();
console.log("Content-Type:", res.headers.get("content-type"));
console.log("X-Chaos-Json-Feed-Mode:", res.headers.get("x-chaos-json-feed-mode"));
console.log("version:", body.version);
console.log("feed_url:", body.feed_url);
const ids = (body.items || []).map(i => i.id);
console.log("item ids:", ids);
console.log("ids unique:", new Set(ids).size === ids.length);
console.log("note:", body.note);
package main

import (
    "encoding/json"
    "fmt"
    "io"
    "net/http"
)

func main() {
    resp, _ := http.Get("https://chaos.catastrophic.io/json-feed?mode=version-mismatch")
    defer resp.Body.Close()
    raw, _ := io.ReadAll(resp.Body)
    var body map[string]any
    json.Unmarshal(raw, &body)
    fmt.Println("Content-Type:", resp.Header.Get("Content-Type"))
    fmt.Println("X-Chaos-Json-Feed-Mode:", resp.Header.Get("X-Chaos-Json-Feed-Mode"))
    fmt.Printf("version: %v\n", body["version"])
    fmt.Printf("feed_url: %v\n", body["feed_url"])
    if items, ok := body["items"].([]any); ok {
        fmt.Println("item count:", len(items))
    }
}
// Cargo.toml: reqwest = { version = "0.12", features = ["blocking", "json"] }
fn main() -> Result<(), Box> {
    let resp = reqwest::blocking::get("https://chaos.catastrophic.io/json-feed?mode=version-mismatch")?;
    println!("Content-Type: {:?}", resp.headers().get("content-type"));
    println!("X-Chaos-Json-Feed-Mode: {:?}", resp.headers().get("x-chaos-json-feed-mode"));
    let body: serde_json::Value = resp.json()?;
    println!("version: {:?}", body.get("version"));
    println!("feed_url: {:?}", body.get("feed_url"));
    if let Some(items) = body.get("items").and_then(|v| v.as_array()) {
        println!("item count: {}", items.len());
    }
    Ok(())
}
import java.net.URI;
import java.net.http.*;

public class JsonFeedChaos {
    public static void main(String[] args) throws Exception {
        var client = HttpClient.newHttpClient();
        var req = HttpRequest.newBuilder(URI.create("https://chaos.catastrophic.io/json-feed?mode=version-mismatch")).build();
        var resp = client.send(req, HttpResponse.BodyHandlers.ofString());
        System.out.println("Content-Type: " +
            resp.headers().firstValue("Content-Type").orElse(""));
        System.out.println("X-Chaos-Json-Feed-Mode: " +
            resp.headers().firstValue("X-Chaos-Json-Feed-Mode").orElse(""));
        System.out.println("Body: " + resp.body());
    }
}
using var client = new HttpClient();
var resp = await client.GetAsync("https://chaos.catastrophic.io/json-feed?mode=version-mismatch");
Console.WriteLine($"Content-Type: {resp.Content.Headers.ContentType}");
Console.WriteLine($"X-Chaos-Json-Feed-Mode: " +
    $"{resp.Headers.GetValues("X-Chaos-Json-Feed-Mode").FirstOrDefault()}");
var body = await resp.Content.ReadAsStringAsync();
Console.WriteLine($"Body: {body}");
require "net/http"
require "json"
uri = URI("https://chaos.catastrophic.io/json-feed?mode=version-mismatch")
Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
    res = http.get(uri.request_uri)
    puts "Content-Type: #{res['Content-Type']}"
    puts "X-Chaos-Json-Feed-Mode: #{res['X-Chaos-Json-Feed-Mode']}"
    body = JSON.parse(res.body)
    puts "version: #{body['version']}"
    puts "feed_url: #{body['feed_url']}"
    ids = (body['items'] || []).map { |i| i['id'] }
    puts "item ids: #{ids.inspect}"
    puts "ids unique: #{ids.uniq.length == ids.length}"
end
$r = Invoke-RestMethod -Uri 'https://chaos.catastrophic.io/json-feed?mode=version-mismatch' -ResponseHeadersVariable h
"Content-Type: $($h['Content-Type'])"
"X-Chaos-Json-Feed-Mode: $($h['X-Chaos-Json-Feed-Mode'])"
"version: $($r.version)"
"feed_url: $($r.feed_url)"
"item count: $($r.items.Count)"