{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/livestockmarketprices-com/json-schema/livestockmarketprices-com-coverage-response-schema.json",
  "title": "CoverageResponse",
  "x-generated": "2026-11-17",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/livestockmarketprices-com-openapi.json#/components/schemas/CoverageResponse",
  "type": "object",
  "required": [
    "data",
    "meta",
    "citation"
  ],
  "additionalProperties": false,
  "properties": {
    "data": {
      "$ref": "#/$defs/CoverageRecord"
    },
    "meta": {
      "$ref": "#/$defs/Meta"
    },
    "citation": {
      "$ref": "#/$defs/Citation"
    }
  },
  "$defs": {
    "Citation": {
      "type": "object",
      "properties": {
        "publisher_name": {
          "type": "string",
          "const": "Livestock Market Prices"
        },
        "canonical_url": {
          "type": "string",
          "format": "uri"
        },
        "primary_sources": {
          "minItems": 1,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "publisher_name": {
                "type": "string",
                "minLength": 1
              },
              "report_url": {
                "type": "string",
                "format": "uri"
              }
            },
            "required": [
              "publisher_name",
              "report_url"
            ],
            "additionalProperties": false
          }
        },
        "sale_dates": {
          "minItems": 1,
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          }
        },
        "retrieved_at": {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
        },
        "dataset_revision": {
          "type": "string",
          "minLength": 1
        },
        "methodology_version": {
          "type": "string",
          "minLength": 1
        },
        "statistic_type": {
          "type": "string",
          "enum": [
            "reported_range",
            "reported_average",
            "reported_weighted_average",
            "publisher_top_of_market_range",
            "derived_midpoint",
            "derived_valuation"
          ]
        },
        "attribution_text": {
          "type": "string",
          "minLength": 1
        },
        "rights_url": {
          "type": "string",
          "format": "uri"
        },
        "use_requirements": {
          "type": "object",
          "properties": {
            "source_attribution_required": {
              "type": "boolean",
              "const": true
            },
            "source_link_required": {
              "type": "boolean",
              "const": true
            },
            "claim_as_original_data_prohibited": {
              "type": "boolean",
              "const": true
            },
            "terms_url": {
              "type": "string",
              "const": "https://livestockmarketprices.com/terms#terms-sources"
            }
          },
          "required": [
            "source_attribution_required",
            "source_link_required",
            "claim_as_original_data_prohibited",
            "terms_url"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "publisher_name",
        "canonical_url",
        "primary_sources",
        "sale_dates",
        "retrieved_at",
        "dataset_revision",
        "methodology_version",
        "statistic_type",
        "attribution_text",
        "rights_url",
        "use_requirements"
      ],
      "additionalProperties": false
    },
    "CoverageRecord": {
      "type": "object",
      "required": [
        "release",
        "report_count",
        "market_count",
        "observation_count",
        "earliest_sale_date",
        "latest_sale_date",
        "markets",
        "regions",
        "species",
        "limitations"
      ],
      "additionalProperties": false,
      "properties": {
        "release": {
          "$ref": "#/$defs/PublicRelease"
        },
        "report_count": {
          "type": "integer",
          "minimum": 0
        },
        "market_count": {
          "type": "integer",
          "minimum": 0
        },
        "observation_count": {
          "type": "integer",
          "minimum": 0
        },
        "earliest_sale_date": {
          "type": "string",
          "format": "date"
        },
        "latest_sale_date": {
          "type": "string",
          "format": "date"
        },
        "markets": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "name",
              "locality",
              "state",
              "country",
              "county",
              "county_fips",
              "canonical_url",
              "region_role",
              "earliest_sale_date",
              "latest_sale_date",
              "observation_count",
              "location"
            ],
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "name": {
                "type": "string",
                "minLength": 1
              },
              "locality": {
                "type": "string",
                "minLength": 1
              },
              "state": {
                "type": "string",
                "minLength": 1
              },
              "country": {
                "type": "string",
                "minLength": 1
              },
              "county": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "county_fips": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^[0-9]{3}$"
              },
              "published_species": {
                "type": "array",
                "uniqueItems": true,
                "items": {
                  "type": "string",
                  "enum": [
                    "cattle",
                    "goat",
                    "sheep"
                  ]
                }
              },
              "reported_species": {
                "type": "array",
                "uniqueItems": true,
                "description": "Source-reported species including combined groups; not a claim of separate price series.",
                "items": {
                  "type": "string",
                  "enum": [
                    "cattle",
                    "goat",
                    "sheep"
                  ]
                }
              },
              "canonical_url": {
                "type": "string",
                "format": "uri"
              },
              "region_role": {
                "type": "string",
                "enum": [
                  "member",
                  "comparison_benchmark"
                ]
              },
              "earliest_sale_date": {
                "type": "string",
                "format": "date"
              },
              "latest_sale_date": {
                "type": "string",
                "format": "date"
              },
              "observation_count": {
                "type": "integer",
                "minimum": 0
              },
              "location": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "address_line1",
                  "postal_code",
                  "latitude",
                  "longitude",
                  "source_url",
                  "verified_at"
                ],
                "properties": {
                  "address_line1": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "postal_code": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "latitude": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "longitude": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "source_url": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uri"
                  },
                  "verified_at": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time"
                  }
                }
              }
            }
          }
        },
        "regions": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "slug",
              "methodology_version",
              "country",
              "state",
              "market_ids"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "name": {
                "type": "string",
                "minLength": 1
              },
              "slug": {
                "type": "string",
                "minLength": 1
              },
              "methodology_version": {
                "type": "string",
                "minLength": 1
              },
              "country": {
                "type": "string",
                "minLength": 2,
                "maxLength": 2
              },
              "state": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "market_ids": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              }
            }
          }
        },
        "species": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "code",
              "earliest_sale_date",
              "latest_sale_date",
              "observation_count"
            ],
            "additionalProperties": false,
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "goat",
                  "sheep",
                  "cattle"
                ]
              },
              "earliest_sale_date": {
                "type": "string",
                "format": "date"
              },
              "latest_sale_date": {
                "type": "string",
                "format": "date"
              },
              "observation_count": {
                "type": "integer",
                "minimum": 0
              }
            }
          }
        },
        "limitations": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "Meta": {
      "type": "object",
      "required": [
        "api_version",
        "dataset_revision",
        "methodology_version",
        "applied_filters",
        "next_cursor",
        "generated_at"
      ],
      "additionalProperties": false,
      "properties": {
        "api_version": {
          "type": "string",
          "const": "1.3.0-alpha.1"
        },
        "dataset_revision": {
          "type": "string"
        },
        "methodology_version": {
          "type": "string"
        },
        "applied_filters": {
          "type": "object",
          "additionalProperties": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              }
            ]
          }
        },
        "next_cursor": {
          "type": [
            "string",
            "null"
          ]
        },
        "generated_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "PublicRelease": {
      "type": "object",
      "required": [
        "id",
        "key",
        "observation_count",
        "quote_count",
        "period_start",
        "period_end"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "key": {
          "type": "string",
          "minLength": 1
        },
        "observation_count": {
          "type": "integer",
          "minimum": 0
        },
        "quote_count": {
          "type": "integer",
          "minimum": 0
        },
        "period_start": {
          "type": "string",
          "format": "date"
        },
        "period_end": {
          "type": "string",
          "format": "date"
        }
      }
    }
  }
}