{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/audioscrape-com/json-schema/audioscrape-com-episode-detail-schema.json",
  "title": "EpisodeDetail",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/audioscrape-com-episodes-api-openapi.yml#/components/schemas/EpisodeDetail",
  "type": "object",
  "required": [
    "episode",
    "entities"
  ],
  "properties": {
    "entities": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/EntityRef"
      }
    },
    "episode": {
      "$ref": "#/$defs/EpisodeFull"
    },
    "podcast": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/$defs/PodcastRef",
          "description": "Present for podcast episodes; `null` for uploaded items (which have no\nparent podcast)."
        }
      ]
    },
    "transcript": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/$defs/Transcript"
        }
      ]
    }
  },
  "$defs": {
    "EntityRef": {
      "type": "object",
      "required": [
        "name",
        "entity_type",
        "slug",
        "mention_count"
      ],
      "properties": {
        "entity_type": {
          "type": "string"
        },
        "mention_count": {
          "type": "integer",
          "format": "int64"
        },
        "name": {
          "type": "string"
        },
        "slug": {
          "type": "string"
        }
      }
    },
    "EpisodeFull": {
      "type": "object",
      "required": [
        "id",
        "title",
        "slug",
        "description",
        "publish_date",
        "processing_status"
      ],
      "properties": {
        "description": {
          "type": "string"
        },
        "duration_seconds": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32"
        },
        "enclosure_url": {
          "type": [
            "string",
            "null"
          ]
        },
        "id": {
          "type": "integer",
          "format": "int64"
        },
        "processing_status": {
          "type": "string",
          "description": "Pipeline lifecycle of this item: `queued` | `processing` |\n`completed` | `completed_no_speech` | `failed` | `cancelled`, or\n`not_transcribed` for catalog items never queued for transcription.\n`completed_no_speech` means processing finished and the audio\ncontained no speech, so no transcript will ever exist: stop polling\nfor one (GH#435)."
        },
        "publish_date": {
          "type": "string"
        },
        "slug": {
          "type": "string"
        },
        "title": {
          "type": "string"
        }
      }
    },
    "PodcastRef": {
      "type": "object",
      "required": [
        "id",
        "title",
        "slug"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "format": "int64"
        },
        "image_url": {
          "type": [
            "string",
            "null"
          ]
        },
        "slug": {
          "type": "string"
        },
        "title": {
          "type": "string"
        }
      }
    },
    "Transcript": {
      "type": "object",
      "required": [
        "segments",
        "speakers",
        "total_segments"
      ],
      "properties": {
        "partial": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/TranscriptPartial",
              "description": "Present (with HTTP 206) when the recording is still being\ntranscribed in parts and `segments` covers only the finished ones.\nSpeaker labels are provisional until the response is a plain 200."
            }
          ]
        },
        "segments": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/TranscriptSegment"
          }
        },
        "speakers": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "total_segments": {
          "type": "integer",
          "minimum": 0
        }
      }
    },
    "TranscriptPartial": {
      "type": "object",
      "required": [
        "pieces_done",
        "pieces_total",
        "seconds_transcribed",
        "seconds_total",
        "speakers_final"
      ],
      "properties": {
        "pieces_done": {
          "type": "integer",
          "format": "int32"
        },
        "pieces_total": {
          "type": "integer",
          "format": "int32"
        },
        "seconds_total": {
          "type": "integer",
          "format": "int64"
        },
        "seconds_transcribed": {
          "type": "integer",
          "format": "int64"
        },
        "speakers_final": {
          "type": "boolean"
        }
      }
    },
    "TranscriptSegment": {
      "type": "object",
      "required": [
        "text",
        "start",
        "end"
      ],
      "properties": {
        "end": {
          "type": "number",
          "format": "double"
        },
        "speaker": {
          "type": [
            "string",
            "null"
          ]
        },
        "start": {
          "type": "number",
          "format": "double"
        },
        "text": {
          "type": "string"
        }
      }
    }
  }
}