{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/emission-factors-com/json-schema/emission-factors-com-lookup-response-schema.json",
  "title": "LookupResponse",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/emission-factors-com-openapi.json#/components/schemas/LookupResponse",
  "type": "object",
  "properties": {
    "zip": {
      "type": "string"
    },
    "candidates": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Candidate"
      }
    },
    "notes": {
      "type": "string"
    },
    "edition_note": {
      "type": "string",
      "description": "Which eGRID edition was used. For the default (2023) it also gives how eGRID2024 differs and the GWP basis (eGRID CO2e uses AR5); for year=2024 it gives the provenance and that the residual mix needs 2023."
    }
  },
  "$defs": {
    "Candidate": {
      "type": "object",
      "properties": {
        "subregion": {
          "type": "string"
        },
        "co2e_kg_per_kwh": {
          "type": "number"
        },
        "co2e_lb_per_mwh": {
          "type": "number"
        },
        "co2_kg_per_kwh": {
          "type": "number"
        },
        "co2_lb_per_mwh": {
          "type": "number"
        },
        "residual_mix_co2e_kg_per_kwh": {
          "type": "number",
          "description": "Green-e residual mix (2023 data): market-based Scope 2 factor. Absent for ?year=2024."
        },
        "residual_mix_co2e_lb_per_mwh": {
          "type": "number"
        },
        "residual_mix_source": {
          "type": "string",
          "description": "Edition, release and CO2e basis (Green-e labels the rate lb CO2/MWh; its system mix equals eGRID CO2e, so it is used as CO2e)"
        },
        "residual_mix_note": {
          "type": "string",
          "description": "Present where Green-e's published residual mix equals its system mix, so market-based equals location-based"
        },
        "data_status": {
          "type": "string",
          "enum": [
            "non_epa"
          ],
          "description": "Present with ?year=2024 (Cornerstone run of EPA code)"
        },
        "data_source": {
          "type": "string",
          "description": "Provenance of non-EPA data (?year=2024)"
        },
        "source_unit": {
          "type": "string"
        },
        "utility": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "primary": {
              "type": "string"
            },
            "eiaid": {
              "type": "integer"
            },
            "ownership": {
              "type": "string"
            },
            "service": {
              "type": "string",
              "enum": [
                "bundled",
                "delivery"
              ]
            },
            "source": {
              "type": "string"
            }
          },
          "description": "Utility serving this ZIP (EIA-861 via OpenEI, 2023), full-service first. null where the ZIP is missing from those lists (about 5% of ZIPs, mostly Texas retail-choice areas; see utility_note)."
        },
        "utility_note": {
          "type": "string",
          "description": "Present when utility is null."
        },
        "utilities": {
          "type": "array",
          "items": {
            "type": "object"
          },
          "description": "All utilities serving the ZIP, when more than one"
        },
        "ch4_kg_per_kwh": {
          "type": "number"
        },
        "ch4_lb_per_mwh": {
          "type": "number"
        },
        "n2o_kg_per_kwh": {
          "type": "number"
        },
        "n2o_lb_per_mwh": {
          "type": "number"
        },
        "co2_nonbaseload_kg_per_kwh": {
          "type": "number"
        },
        "co2_nonbaseload_lb_per_mwh": {
          "type": "number"
        },
        "nox_lb_per_mwh": {
          "type": "number",
          "description": "NOx total output emission rate (lb/MWh) - air quality / Title V"
        },
        "nox_kg_per_kwh": {
          "type": "number"
        },
        "so2_lb_per_mwh": {
          "type": "number",
          "description": "SO2 total output emission rate (lb/MWh) - acid rain, air quality"
        },
        "so2_kg_per_kwh": {
          "type": "number"
        },
        "carbon_free_pct": {
          "type": "number",
          "description": "Percent of generation from nuclear + renewables"
        },
        "renewable_pct": {
          "type": "number"
        },
        "generation_mix": {
          "type": "object",
          "properties": {
            "coal_pct": {
              "type": "number"
            },
            "oil_pct": {
              "type": "number"
            },
            "gas_pct": {
              "type": "number"
            },
            "nuclear_pct": {
              "type": "number"
            },
            "hydro_pct": {
              "type": "number"
            },
            "biomass_pct": {
              "type": "number"
            },
            "wind_pct": {
              "type": "number"
            },
            "solar_pct": {
              "type": "number"
            },
            "geothermal_pct": {
              "type": "number"
            },
            "other_fossil_pct": {
              "type": "number"
            },
            "other_pct": {
              "type": "number"
            }
          }
        },
        "data_year": {
          "type": "string"
        },
        "methodology": {
          "type": "string"
        }
      }
    }
  }
}