{
 "openapi": "3.1.0",
 "info": {
  "title": "London's electricity carbon intensity (NESO): data.promptugal.news",
  "version": "v0.1.151",
  "description": "The carbon intensity of the electricity used in London, for the current half hour and forecast 48 hours ahead, with the generation mix.\n\nPublisher: National Energy System Operator (NESO), Carbon Intensity API. Reuse terms: The API definitions state CC BY 4.0 and that no operation needs authentication. The API terms: NESO provides the API for free, applies a rate limit and may block applications that make a large number of calls; no selling, leasing or sublicensing of the API, no application that substantially replaces the core user experience, and no NESO logo without written approval. Not a warning service: follow IPMA and ANEPC.\n\nCode: Apache-2.0. Text: CC BY 4.0. The data keeps the terms of its own source (see each source card); nothing here relaxes them.",
  "license": {
   "name": "Apache-2.0 for code; each source keeps its own data terms",
   "identifier": "Apache-2.0"
  },
  "contact": {
   "name": "PrompTugal.news data",
   "url": "https://github.com/PrompTugal/PrompTugal__News__Data"
  }
 },
 "servers": [
  {
   "url": "https://data.promptugal.news",
   "description": "Production"
  }
 ],
 "externalDocs": {
  "description": "How to use the API",
  "url": "https://data.promptugal.news/api/"
 },
 "paths": {
  "/api/v1/carbon-intensity-london/latest.json": {
   "get": {
    "operationId": "get_carbon_intensity_london_latest",
    "tags": [
     "carbon-intensity-london"
    ],
    "summary": "London's electricity carbon intensity (NESO): the latest read",
    "description": "The carbon intensity of the electricity used in London (NESO's London region, UKPN London) in grams of CO2 per kWh, for the half hour of the read and forecast for the next 48 hours, each with its index (very low to very high) and the generation mix in per cent. Collected once a day as the archive; the page shows the live half hour read in your browser.",
    "responses": {
     "200": {
      "description": "The file",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "source": {
           "type": "string"
          },
          "title": {
           "type": "string"
          },
          "read_at": {
           "type": "string"
          },
          "provenance": {
           "type": "object",
           "properties": {
            "source": {
             "type": "string"
            },
            "page": {
             "type": "string"
            },
            "read_at": {
             "type": "string"
            },
            "by": {
             "type": "string"
            },
            "terms": {
             "type": "string"
            },
            "api": {
             "type": "string"
            },
            "forecast_api": {
             "type": "string"
            }
           },
           "required": [
            "source",
            "page",
            "read_at",
            "by",
            "terms",
            "api",
            "forecast_api"
           ]
          },
          "country": {
           "type": "string"
          },
          "place": {
           "type": "string"
          },
          "about": {
           "type": "string"
          },
          "live": {
           "type": "object",
           "properties": {
            "url": {
             "type": "string"
            },
            "how": {
             "type": "string"
            }
           },
           "required": [
            "url",
            "how"
           ]
          },
          "attribution": {
           "type": "string"
          },
          "region": {
           "type": "object",
           "properties": {
            "id": {
             "type": "integer"
            },
            "name": {
             "type": "string"
            },
            "dno": {
             "type": "string"
            }
           },
           "required": [
            "id",
            "name",
            "dno"
           ]
          },
          "now": {
           "type": "object",
           "properties": {
            "from": {
             "type": "string"
            },
            "to": {
             "type": "string"
            },
            "forecast_gco2_kwh": {
             "type": "integer"
            },
            "index": {
             "type": "string"
            },
            "mix": {
             "type": "object",
             "properties": {
              "biomass": {
               "type": "integer"
              },
              "coal": {
               "type": "integer"
              },
              "imports": {
               "type": "number"
              },
              "gas": {
               "type": "number"
              },
              "nuclear": {
               "type": "number"
              },
              "other": {
               "type": "integer"
              },
              "hydro": {
               "type": "number"
              },
              "solar": {
               "type": "number"
              },
              "wind": {
               "type": "number"
              }
             },
             "required": [
              "biomass",
              "coal",
              "imports",
              "gas",
              "nuclear",
              "other",
              "hydro",
              "solar",
              "wind"
             ]
            }
           },
           "required": [
            "from",
            "to",
            "forecast_gco2_kwh",
            "index",
            "mix"
           ]
          },
          "counts": {
           "type": "object",
           "properties": {
            "forecast_periods": {
             "type": "integer"
            }
           },
           "required": [
            "forecast_periods"
           ]
          },
          "forecast": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "from": {
              "type": "string"
             },
             "to": {
              "type": "string"
             },
             "forecast_gco2_kwh": {
              "type": "integer"
             },
             "index": {
              "type": "string"
             },
             "mix": {
              "type": "object",
              "properties": {
               "biomass": {
                "type": "number"
               },
               "coal": {
                "type": "integer"
               },
               "imports": {
                "type": "number"
               },
               "gas": {
                "type": "number"
               },
               "nuclear": {
                "type": "number"
               },
               "other": {
                "type": "integer"
               },
               "hydro": {
                "type": "number"
               },
               "solar": {
                "type": "number"
               },
               "wind": {
                "type": "number"
               }
              },
              "required": [
               "biomass",
               "coal",
               "imports",
               "gas",
               "nuclear",
               "other",
               "hydro",
               "solar",
               "wind"
              ]
             }
            },
            "required": [
             "from",
             "to",
             "forecast_gco2_kwh",
             "index",
             "mix"
            ]
           }
          }
         },
         "required": [
          "source",
          "title",
          "read_at",
          "provenance",
          "country",
          "place",
          "about",
          "live",
          "attribution",
          "region",
          "now",
          "counts",
          "forecast"
         ],
         "x-inferred": true
        },
        "examples": {
         "example": {
          "summary": "A real file, cut to a readable size",
          "value": {
           "source": "carbon-intensity-london",
           "title": "London's electricity carbon intensity (NESO)",
           "read_at": "2026-11-21T09:19:18Z",
           "provenance": {
            "source": "https://carbonintensity.org.uk/",
            "page": "https://carbon-intensity.github.io/api-definitions/",
            "read_at": "2026-11-21T09:19:18Z",
            "by": "sources/carbon-intensity-london/collect.mjs (code, no model; run by data.b@PrompTugal.dinis)",
            "terms": "The API definitions state CC BY 4.0 and that no operation needs authentication. The API terms: NESO provides the API for free, applies a rate limit and may block applications that make a large number of calls; no selling, leasing or sublicensing of the API, no application that substantially replaces...",
            "api": "https://api.carbonintensity.org.uk/regional/regionid/13",
            "forecast_api": "https://api.carbonintensity.org.uk/regional/intensity/2026-11-21T09:00Z/fw48h/regionid/13"
           },
           "country": "GB",
           "place": "london",
           "about": "The carbon intensity of the electricity used in London (NESO's London region, UKPN London) in grams of CO2 per kWh, for the half hour of the read and forecast for the next 48 hours, each with its index (very low to very high) and the generation mix in per cent. Collected once a day as the archive; t...",
           "live": {
            "url": "https://api.carbonintensity.org.uk/regional/regionid/13",
            "how": "the page asks the Carbon Intensity API for this address when it opens; the API allows browser reads (CORS *)"
           },
           "attribution": "Carbon Intensity API, National Energy System Operator (NESO), CC BY 4.0",
           "region": {
            "id": 13,
            "name": "London",
            "dno": "UKPN London"
           },
           "now": {
            "from": "2026-11-21T08:30Z",
            "to": "2026-11-21T09:00Z",
            "forecast_gco2_kwh": 223,
            "index": "high",
            "mix": {
             "biomass": 6,
             "coal": 0,
             "imports": 41.1,
             "gas": 39.5,
             "nuclear": 9.1,
             "other": 0,
             "hydro": 0.2,
             "solar": 1.2,
             "wind": 2.8
            }
           },
           "counts": {
            "forecast_periods": 97
           },
           "forecast": [
            {
             "from": "2026-11-21T08:30Z",
             "to": "2026-11-21T09:00Z",
             "forecast_gco2_kwh": 223,
             "index": "high",
             "mix": {
              "biomass": 6,
              "coal": 0,
              "imports": 41.1,
              "gas": 39.5,
              "nuclear": 9.1,
              "other": 0,
              "hydro": 0.2,
              "solar": 1.2,
              "wind": 2.8
             }
            },
            {
             "from": "2026-11-21T09:00Z",
             "to": "2026-11-21T09:30Z",
             "forecast_gco2_kwh": 228,
             "index": "high",
             "mix": {
              "biomass": 6.1,
              "coal": 0,
              "imports": 39.1,
              "gas": 40.2,
              "nuclear": 9.2,
              "other": 0,
              "hydro": 0.2,
              "solar": 2.2,
              "wind": 2.9
             }
            },
            {
             "from": "2026-11-21T09:30Z",
             "to": "2026-11-21T10:00Z",
             "forecast_gco2_kwh": 220,
             "index": "high",
             "mix": {
              "biomass": 6,
              "coal": 0,
              "imports": 39.4,
              "gas": 38.7,
              "nuclear": 9.2,
              "other": 0,
              "hydro": 0.2,
              "solar": 3.5,
              "wind": 3
             }
            }
           ]
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "No such file"
     }
    }
   }
  },
  "/api/v1/carbon-intensity-london/reads.json": {
   "get": {
    "operationId": "get_carbon_intensity_london_reads",
    "tags": [
     "carbon-intensity-london"
    ],
    "summary": "London's electricity carbon intensity (NESO): every read, newest first",
    "description": "Every run of sources/carbon-intensity-london/collect.mjs, newest first: each request's address, HTTP status, size, the first 16 hex of its sha256, and whether the bytes changed since the run before. The bytes and the full sha256 go to the source's vault (see card.json: latest/reads-full.json), never to git.",
    "responses": {
     "200": {
      "description": "The file",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "about": {
           "type": "string"
          },
          "source": {
           "type": "string"
          },
          "runs": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "at": {
              "type": "string"
             },
             "finished": {
              "type": "string"
             },
             "ok": {
              "type": "integer"
             },
             "failed": {
              "type": "integer"
             },
             "reads": {
              "type": "array",
              "items": {
               "type": "object",
               "properties": {
                "name": {
                 "type": "string"
                },
                "url": {
                 "type": "string"
                },
                "at": {
                 "type": "string"
                },
                "status": {
                 "type": "integer"
                },
                "bytes": {
                 "type": "integer"
                },
                "sha256_prefix": {
                 "type": "string"
                },
                "changed": {
                 "type": "string"
                }
               },
               "required": [
                "name",
                "url",
                "at",
                "status",
                "bytes",
                "sha256_prefix",
                "changed"
               ]
              }
             }
            },
            "required": [
             "at",
             "finished",
             "ok",
             "failed",
             "reads"
            ]
           }
          }
         },
         "required": [
          "about",
          "source",
          "runs"
         ],
         "x-inferred": true
        },
        "examples": {
         "example": {
          "summary": "A real file, cut to a readable size",
          "value": {
           "about": "Every run of sources/carbon-intensity-london/collect.mjs, newest first: each request's address, HTTP status, size, the first 16 hex of its sha256, and whether the bytes changed since the run before. The bytes and the full sha256 go to the source's vault (see card.json: latest/reads-full.json), never...",
           "source": "carbon-intensity-london",
           "runs": [
            {
             "at": "2026-11-21T09:19:18Z",
             "finished": "2026-11-21T09:19:22Z",
             "ok": 2,
             "failed": 0,
             "reads": [
              {
               "name": "now",
               "url": "https://api.carbonintensity.org.uk/regional/regionid/13",
               "at": "2026-11-21T09:19:18Z",
               "status": 200,
               "bytes": 448,
               "sha256_prefix": "823d548bbc41a258",
               "changed": "first read"
              },
              {
               "name": "forecast-48h",
               "url": "https://api.carbonintensity.org.uk/regional/intensity/2026-11-21T09:00Z/fw48h/regionid/13",
               "at": "2026-11-21T09:19:21Z",
               "status": 200,
               "bytes": 35752,
               "sha256_prefix": "62ef784c38e98cf7",
               "changed": "first read"
              }
             ]
            }
           ]
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "No such file"
     }
    }
   }
  },
  "/api/v1/carbon-intensity-london/card.json": {
   "get": {
    "operationId": "get_carbon_intensity_london_card",
    "tags": [
     "carbon-intensity-london"
    ],
    "summary": "London's electricity carbon intensity (NESO): the card",
    "description": "Who publishes the source, its reuse terms, the schedule, who owns it, what runs by code, by agents and by people, and the vault.",
    "responses": {
     "200": {
      "description": "The file",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "id": {
           "type": "string"
          },
          "title": {
           "type": "string"
          },
          "what": {
           "type": "string"
          },
          "publisher": {
           "type": "string"
          },
          "owner": {
           "type": "string"
          },
          "region": {
           "type": "string"
          },
          "collector": {
           "type": "string"
          },
          "source_home": {
           "type": "string"
          },
          "reader_page": {
           "type": "string"
          },
          "schedule": {
           "type": "object",
           "properties": {
            "cadence": {
             "type": "string"
            },
            "how": {
             "type": "string"
            }
           },
           "required": [
            "cadence",
            "how"
           ]
          },
          "terms": {
           "type": "object",
           "properties": {
            "summary": {
             "type": "string"
            },
            "page": {
             "type": "string"
            },
            "terms_page": {
             "type": "string"
            },
            "read_at": {
             "type": "string"
            },
            "quote": {
             "type": "string"
            },
            "quote_lang": {
             "type": "string"
            },
            "republish": {
             "type": "string"
            },
            "commercial_use": {
             "type": "string"
            },
            "commercial_note": {
             "type": "string"
            }
           },
           "required": [
            "summary",
            "page",
            "terms_page",
            "read_at",
            "quote",
            "quote_lang",
            "republish",
            "commercial_use",
            "commercial_note"
           ]
          },
          "api": {
           "type": "object",
           "properties": {
            "latest": {
             "type": "string"
            },
            "reads": {
             "type": "string"
            },
            "card": {
             "type": "string"
            },
            "openapi": {
             "type": "string"
            },
            "page": {
             "type": "string"
            }
           },
           "required": [
            "latest",
            "reads",
            "card",
            "openapi",
            "page"
           ]
          },
          "vault": {
           "type": "null"
          },
          "split": {
           "type": "object",
           "properties": {
            "code": {
             "type": "array",
             "items": {
              "type": "string"
             }
            },
            "agents": {
             "type": "array",
             "items": {
              "type": "string"
             }
            },
            "people": {
             "type": "array",
             "items": {
              "type": "string"
             }
            }
           },
           "required": [
            "code",
            "agents",
            "people"
           ]
          },
          "cost": {
           "type": "object",
           "properties": {
            "per_run_tokens": {
             "type": "integer"
            },
            "per_run_model_cost_usd": {
             "type": "integer"
            },
            "runner": {
             "type": "string"
            },
            "build_tokens": {
             "type": "string"
            },
            "note": {
             "type": "string"
            }
           },
           "required": [
            "per_run_tokens",
            "per_run_model_cost_usd",
            "runner",
            "build_tokens",
            "note"
           ]
          },
          "since": {
           "type": "string"
          },
          "places": {
           "type": "array",
           "items": {
            "type": "string"
           }
          },
          "country": {
           "type": "string"
          }
         },
         "required": [
          "id",
          "title",
          "what",
          "publisher",
          "owner",
          "region",
          "collector",
          "source_home",
          "reader_page",
          "schedule",
          "terms",
          "api",
          "vault",
          "split",
          "cost",
          "since",
          "places",
          "country"
         ],
         "x-inferred": true
        },
        "examples": {
         "example": {
          "summary": "A real file, cut to a readable size",
          "value": {
           "id": "carbon-intensity-london",
           "title": "London's electricity carbon intensity (NESO)",
           "what": "The carbon intensity of the electricity used in London, for the current half hour and forecast 48 hours ahead, with the generation mix.",
           "publisher": "National Energy System Operator (NESO), Carbon Intensity API",
           "owner": "data.b@PrompTugal.dinis",
           "region": "london",
           "collector": "sources/carbon-intensity-london/collect.mjs",
           "source_home": "https://carbonintensity.org.uk/",
           "reader_page": "https://carbon-intensity.github.io/api-definitions/",
           "schedule": {
            "cadence": "daily",
            "how": "once a day at data.b@'s morning wake: two GETs (now and the 48-hour forecast for region 13), no key; the page reads the current half hour live in the browser"
           },
           "terms": {
            "summary": "The API definitions state CC BY 4.0 and that no operation needs authentication. The API terms: NESO provides the API for free, applies a rate limit and may block applications that make a large number of calls; no selling, leasing or sublicensing of the API, no application that substantially replaces...",
            "page": "https://carbon-intensity.github.io/api-definitions/",
            "terms_page": "https://github.com/carbon-intensity/terms",
            "read_at": "2026-11-21",
            "quote": "National Energy System Operator is currently providing you the Carbon Intensity API for free.",
            "quote_lang": "en",
            "republish": "yes, CC BY 4.0 with credit to NESO; we show London's figures on our own page, read once a day and live in the browser",
            "commercial_use": "allowed",
            "commercial_note": "CC BY 4.0 allows commercial use; the API terms bar selling or sublicensing the API itself."
           },
           "api": {
            "latest": "https://data.promptugal.news/api/v1/carbon-intensity-london/latest.json",
            "reads": "https://data.promptugal.news/api/v1/carbon-intensity-london/reads.json",
            "card": "https://data.promptugal.news/api/v1/carbon-intensity-london/card.json",
            "openapi": "https://data.promptugal.news/api/v1/carbon-intensity-london/openapi.json",
            "page": "https://data.promptugal.news/sources/carbon-intensity-london/"
           },
           "vault": null,
           "split": {
            "code": [
             "the collector reads the source once a day and keeps the archive; the page reads the live figures in the visitor's browser"
            ],
            "agents": [
             "data.b@PrompTugal.dinis wrote the collector and card on 21 November 2026, for Dinis's London demos (tier 1 of board/team/data/london-feeds.md)"
            ],
            "people": [
             "Dinis Cruz chose tier 1 on 21 November 2026, about 09:16 UTC; no person has checked the values (not reviewed)"
            ]
           },
           "cost": {
            "per_run_tokens": 0,
            "per_run_model_cost_usd": 0,
            "runner": "data.b@'s session",
            "build_tokens": "not measured",
            "note": "Code only: no model is called when the data is collected."
           },
           "since": "2026-11-21",
           "places": [
            "london"
           ],
           "country": "GB"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "No such file"
     }
    }
   }
  },
  "/api/v1/carbon-intensity-london/openapi.json": {
   "get": {
    "operationId": "get_carbon_intensity_london_openapi",
    "tags": [
     "carbon-intensity-london"
    ],
    "summary": "London's electricity carbon intensity (NESO): this document",
    "responses": {
     "200": {
      "description": "The file",
      "content": {
       "application/json": {
        "schema": {
         "type": "string"
        }
       }
      }
     }
    }
   }
  }
 },
 "tags": [
  {
   "name": "carbon-intensity-london",
   "description": "The carbon intensity of the electricity used in London, for the current half hour and forecast 48 hours ahead, with the generation mix."
  }
 ],
 "x-source": {
  "id": "carbon-intensity-london",
  "card": "https://data.promptugal.news/api/v1/carbon-intensity-london/card.json",
  "page": "https://data.promptugal.news/sources/carbon-intensity-london/"
 }
}
