{"openapi":"3.1.0","info":{"title":"Dataminal API: Electricity","version":"1.0","summary":"Nigerian economic, market and election data as read-only JSON.","description":"Structured Nigerian economic, market and election data from the institutions that publish it, as read-only JSON. Every data response is `{ \"count\": n, \"data\": [ ... ] }` of flat records, and most rows name the release they came from.\n\n**Authentication.** Send your API key in the `X-Api-Key` header, from a server or a script, never from a web page and never in a URL (a key in a URL is refused). Without a key, catalog and metadata routes answer in full and data routes return a ten-row sample with an `access` note. Get a key: sign in at dataminal.com, open Settings, API access, and say what you will build; every request is reviewed. A key reads only the datasets approved for it.\n\n**Limits.** Developer key: 1,000 rows per response, 60 requests a minute, 5,000 a day, 100,000 a month, 100,000 rows a day, daily series 366 days per request, `offset` up to 2,000. Production key: 5,000 rows per response, 120 a minute, 20,000 a day, 400,000 a month, 1,000,000 rows a day, daily series five years per request, `offset` up to 10,000. A key that makes more than 600 different requests in an hour (2,000 on Production) is paused for six hours, so narrow requests with filters (metric, state, period, from/to) rather than walking a table request by request. Responses carry `X-RateLimit-Remaining` and `X-Quota-Remaining`; a 429 carries `Retry-After` (seconds). Every key on an account shares one quota.\n\n**Formats.** JSON only. To save CSV, write the `data` array out, for example `pandas.DataFrame(body[\"data\"]).to_csv(\"file.csv\", index=False)`. Banking and private capital also offer whole-dataset files through `/download?file=` routes, which return a link valid for five minutes.\n\n**Errors.** 400 invalid parameters (the message names the accepted format), 401 missing, revoked or expired key, 403 licensed data or a dataset this key is not approved for, 404 unknown route, 429 rate limit or used-up quota, 503 quota check unavailable (retry after `Retry-After`). The body is `{ \"error\": \"...\", \"code\": \"...\" }`.\n\nHuman reference: https://dataminal.com/developers. Terms: https://dataminal.com/terms.","termsOfService":"https://dataminal.com/terms","contact":{"name":"Dataminal","email":"research@dataminal.com","url":"https://dataminal.com/developers"}},"servers":[{"url":"https://api.dataminal.com"}],"externalDocs":{"description":"API reference","url":"https://dataminal.com/developers"},"security":[{"ApiKey":[]},{}],"tags":[{"name":"Electricity","externalDocs":{"url":"https://dataminal.com/nigeria/electricity?tab=api"}}],"paths":{"/nigeria/electricity/grid/latest":{"get":{"tags":["Electricity"],"operationId":"electricity__grid_latest","summary":"Latest day","description":"Returns the grid summary for the most recent day with readings: hourly peak and low, energy by fuel, and the operator's reported figures where captured.\n\nReference: https://dataminal.com/nigeria/electricity?tab=api","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Rows"},"example":{"count":1,"data":[{"date":"2026-09-04","plants_reporting":20,"plants_online":20,"hours_reported":24,"peak_hourly_mw":4543.36,"peak_hour_ending":21,"offpeak_hourly_mw":4024.52,"offpeak_hour_ending":11,"mean_mw":4260.87,"energy_mwh":102260.93,"hydro_mwh":30466.48,"gas_mwh":71794.45,"other_mwh":0,"hydro_share_pct":29.793,"reported_peak_mw":4925,"reported_peak_time":"21:15","reported_energy_generated_mwh":107932.38,"reported_energy_sent_out_mwh":106320.33,"reported_transmission_loss_mwh":1612.05,"warning_count":0}]}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/nigeria/electricity/grid/daily":{"get":{"tags":["Electricity"],"operationId":"electricity__grid_daily","summary":"Daily grid series","description":"Returns one row per day, newest first, optionally within a date range. complete says whether the day's record is whole; notes state the rule and the caveat on the record before September 2019.\n\nReference: https://dataminal.com/nigeria/electricity?tab=api","parameters":[{"name":"from","in":"query","required":false,"description":"First day to include, YYYY-MM-DD.","schema":{"type":"string","format":"date"},"example":"2026-08-01"},{"name":"to","in":"query","required":false,"description":"Last day to include, YYYY-MM-DD.","schema":{"type":"string","format":"date"},"example":"2026-08-31"},{"name":"limit","in":"query","required":false,"description":"Maximum rows to return. Defaults to 365, capped at 5000.","schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Rows"},"example":{"count":31,"data":[{"date":"2026-08-31","plants_reporting":22,"missing_hours":0,"complete":true,"peak_hourly_mw":4402.11,"energy_mwh":98211.5,"hydro_share_pct":31.2}],"notes":["A day is complete when at least 13 plants report and no hour is missing ..."]}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/nigeria/electricity/grid/monthly":{"get":{"tags":["Electricity"],"operationId":"electricity__grid_monthly","summary":"Monthly grid aggregates","description":"Aggregates the daily series by month over complete days without an implausible reading (complete_days, coverage_pct): mean generation, hourly peak and low, energy per day, total energy and its split by fuel, and the operator's reported totals where captured. Averages and extremes are null when complete days are fewer than two thirds of the month; totals are null unless every day counts, so a month in progress has none.\n\nReference: https://dataminal.com/nigeria/electricity?tab=api","parameters":[{"name":"from","in":"query","required":false,"description":"First day to include, YYYY-MM-DD.","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","required":false,"description":"Last day to include, YYYY-MM-DD.","schema":{"type":"string","format":"date"}},{"name":"limit","in":"query","required":false,"description":"Maximum rows to return. Defaults to 120, capped at 240.","schema":{"type":"integer"},"example":12}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Rows"},"example":{"count":12,"data":[{"month":"2026-08-01","days_in_month":31,"days_reported":31,"days_with_readings":31,"days_incomplete":0,"days_flagged":0,"complete_days":31,"coverage_pct":100,"mean_mw":3907.69,"max_peak_hourly_mw":4918.55,"mean_daily_energy_mwh":93784.62,"energy_mwh":2907323.25,"hydro_mwh":1128705.34,"gas_mwh":1778465.01,"hydro_share_pct":38.82}],"notes":["...","...","..."]}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/nigeria/electricity/grid/plants":{"get":{"tags":["Electricity"],"operationId":"electricity__grid_plants","summary":"Generation by plant","description":"Returns one row per plant for a day (default: the latest day), or a plant's daily history when a plant key is given.\n\nReference: https://dataminal.com/nigeria/electricity?tab=api","parameters":[{"name":"date","in":"query","required":false,"description":"Day as YYYY-MM-DD. Defaults to the latest day with readings.","schema":{"type":"string","format":"date"}},{"name":"plant","in":"query","required":false,"description":"Plant key such as egbin, kainji or azura_edo_ipp.","schema":{"type":"string"},"example":"egbin"},{"name":"from","in":"query","required":false,"description":"First day to include, YYYY-MM-DD.","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","required":false,"description":"Last day to include, YYYY-MM-DD.","schema":{"type":"string","format":"date"}},{"name":"limit","in":"query","required":false,"description":"Maximum rows to return. Defaults to 500, capped at 5000.","schema":{"type":"integer"},"example":3}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Rows"},"example":{"count":3,"data":[{"date":"2026-09-04","plant":"EGBIN (STEAM)","plant_key":"egbin","fuel":"gas","technology":"steam_turbine","ownership":"other","hours_reported":24,"hours_online":24,"mean_mw":622,"max_mw":643,"min_mw":563,"energy_mwh":14928,"portal_energy_mwh":14928,"share_of_generation_pct":14.6}]}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/nigeria/electricity/grid/hourly":{"get":{"tags":["Electricity"],"operationId":"electricity__grid_hourly","summary":"Hourly generation","description":"Returns the hour-ending readings (MW) for every plant on a day, or one plant when a key is given.\n\nReference: https://dataminal.com/nigeria/electricity?tab=api","parameters":[{"name":"date","in":"query","required":false,"description":"Day as YYYY-MM-DD. Defaults to the latest day with readings.","schema":{"type":"string","format":"date"},"example":"2026-09-04"},{"name":"plant","in":"query","required":false,"description":"Plant key such as egbin, kainji or azura_edo_ipp.","schema":{"type":"string"},"example":"kainji"},{"name":"limit","in":"query","required":false,"description":"Maximum rows to return. Defaults to 1000, capped at 5000.","schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Rows"},"example":{"count":24,"data":[{"date":"2026-09-04","hour_ending":1,"plant":"KAINJI (HYDRO)","plant_key":"kainji","fuel":"hydro","mw":380}]}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/nigeria/electricity/plants":{"get":{"tags":["Electricity"],"operationId":"electricity__plants","summary":"Plant registry","description":"Every plant seen on the portal with its fuel, technology, ownership class, first and last day observed, days online, highest output, and energy over the last 30 and 365 days.\n\nReference: https://dataminal.com/nigeria/electricity?tab=api","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Rows"},"example":{"count":30,"data":[{"plant_key":"egbin","plant":"EGBIN (STEAM)","fuel":"gas","technology":"steam_turbine","ownership":"other","first_seen":"2018-01-01","last_seen":"2026-09-04","days_reported":3100,"days_online":3080,"max_mw":1080,"implausible_hours":2,"mean_mw_30d":620.4,"energy_mwh_30d":446688,"energy_mwh_365d":5200000}]}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/nigeria/electricity/discos/latest":{"get":{"tags":["Electricity"],"operationId":"electricity__discos_latest","summary":"Distribution companies, latest month","description":"Returns every distribution company and the all-company total for the latest month in the NBS series.\n\nReference: https://dataminal.com/nigeria/electricity?tab=api","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Rows"},"example":{"count":12,"data":[{"month":"2025-12-01","disco":"DISCOS","disco_key":"discos","is_total":true,"customers_total":14100000,"customers_metered":6900000,"metered_share_pct":48.9,"revenue_collected_ngn":250000000000,"energy_billed_gwh":2250,"revenue_per_kwh_ngn":111.1,"source_release":"2025Q4"}]}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/nigeria/electricity/discos/monthly":{"get":{"tags":["Electricity"],"operationId":"electricity__discos_monthly","summary":"Distribution companies, monthly series","description":"Returns the monthly series for all companies, one company (disco key), or one month.\n\nReference: https://dataminal.com/nigeria/electricity?tab=api","parameters":[{"name":"disco","in":"query","required":false,"description":"Company key: abuja, benin, eko, enugu, ibadan, ikeja, jos, kaduna, kano, port_harcourt, yola, or discos for the total.","schema":{"type":"string"},"example":"ikeja"},{"name":"month","in":"query","required":false,"description":"Month as YYYY-MM.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Maximum rows to return. Defaults to 2000, capped at 5000.","schema":{"type":"integer"},"example":2}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Rows"},"example":{"count":2,"data":[{"month":"2025-12-01","disco":"IKEJA (IEDC)","disco_key":"ikeja","customers_total":1500000,"energy_billed_gwh":380,"revenue_collected_ngn":50000000000}]}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/nigeria/electricity/releases":{"get":{"tags":["Electricity"],"operationId":"electricity__releases","summary":"NBS releases","description":"Returns the quarterly NBS releases ingested, newest first.\n\nReference: https://dataminal.com/nigeria/electricity?tab=api","parameters":[{"name":"limit","in":"query","required":false,"description":"Maximum rows to return. Defaults to 24, capped at 100.","schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Rows"},"example":{"count":6,"data":[{"release_id":"nbs-electricity-2025Q4","quarter":"2025Q4","series_start":"2015-01","series_end":"2025-12","month_count":132,"resource_title":"Nigeria Electricity Report Q4 2024-Q4 2025","bundle":true,"publication_date":"2026-06-29","warning_count":4}]}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}}},"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"X-Api-Key","description":"Request a key at dataminal.com: Settings, API access."}},"schemas":{"Rows":{"type":"object","properties":{"count":{"type":"integer"},"data":{"type":"array","items":{"type":"object","additionalProperties":true}},"access":{"type":"object","description":"Present when rows were limited: a sample, a cap, or a history window.","additionalProperties":true}},"additionalProperties":true},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"code":{"type":"string"},"docs":{"type":"string"}}}},"responses":{"Error":{"description":"An error with a message saying what to change. 429 carries Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}
