{
  "openapi": "3.1.0",
  "info": {
    "title": "KIDS public API",
    "version": "1.0.0",
    "description": "Fact-checks of children’s health claims from KIDS (ourkids.si), the KIDS apps, and a list for news of new apps. Fact-checks are AI-generated from the cited sources and independently AI-audited; they are not reviewed by doctors and are not medical advice.",
    "contact": {
      "email": "nick@0xlaunch.me",
      "url": "https://ourkids.si/support"
    }
  },
  "servers": [
    {
      "url": "https://ourkids.si"
    }
  ],
  "paths": {
    "/api/v1/claims": {
      "get": {
        "operationId": "searchClaims",
        "summary": "Search or list fact-checked claims",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 100
            },
            "description": "Words to search for, e.g. \"sugar hyperactive\". Omit for the latest claims."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching claims",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "claims": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "claim": {
                            "type": "string"
                          },
                          "slug": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string",
                            "format": "uri"
                          },
                          "category": {
                            "type": "string"
                          },
                          "verdict": {
                            "type": "string",
                            "enum": [
                              "supported",
                              "mixed",
                              "not_supported"
                            ]
                          },
                          "verdict_label": {
                            "type": "string"
                          },
                          "evidence_strength": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 3,
                            "description": "1 limited, 2 moderate, 3 strong"
                          },
                          "summary": {
                            "type": "string"
                          },
                          "findings": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "caveats": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "sources": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "title": {
                                  "type": "string"
                                },
                                "publisher": {
                                  "type": "string"
                                },
                                "url": {
                                  "type": "string",
                                  "format": "uri"
                                }
                              }
                            }
                          },
                          "ages": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "checked_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "ai_generated": {
                            "type": "boolean"
                          },
                          "disclaimer": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/claims/{slug}": {
      "get": {
        "operationId": "getClaim",
        "summary": "Get one fact-check",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The fact-check",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "claim": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "category": {
                      "type": "string"
                    },
                    "verdict": {
                      "type": "string",
                      "enum": [
                        "supported",
                        "mixed",
                        "not_supported"
                      ]
                    },
                    "verdict_label": {
                      "type": "string"
                    },
                    "evidence_strength": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 3,
                      "description": "1 limited, 2 moderate, 3 strong"
                    },
                    "summary": {
                      "type": "string"
                    },
                    "findings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "caveats": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "sources": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "publisher": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string",
                            "format": "uri"
                          }
                        }
                      }
                    },
                    "ages": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "checked_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "ai_generated": {
                      "type": "boolean"
                    },
                    "disclaimer": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/apps": {
      "get": {
        "operationId": "listApps",
        "summary": "List the KIDS apps for parents, with App Store links and privacy details",
        "responses": {
          "200": {
            "description": "The apps",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "apps": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          },
                          "app_store_url": {
                            "type": "string"
                          },
                          "app_store_id": {
                            "type": "string"
                          },
                          "platform": {
                            "type": "string"
                          },
                          "summary": {
                            "type": "string"
                          },
                          "pricing": {
                            "type": "string"
                          },
                          "privacy": {
                            "type": "string"
                          },
                          "features": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "privacy_policy": {
                            "type": "string"
                          },
                          "support": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/waitlist": {
      "post": {
        "operationId": "joinWaitlist",
        "summary": "Add an email to hear about new KIDS apps (only with the person’s permission)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "product": {
                    "type": "string",
                    "enum": [
                      "next"
                    ],
                    "default": "next",
                    "description": "next = new KIDS apps"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Added (or already on the list)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid email"
          }
        }
      }
    }
  }
}