-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.json
More file actions
1 lines (1 loc) · 17.4 KB
/
Copy pathopenapi.json
File metadata and controls
1 lines (1 loc) · 17.4 KB
1
{"openapi":"3.1.0","info":{"title":"OpenElectricity - v4.0","version":"v4.0"},"paths":{"/v4/data/facilities/{network_code}":{"get":{"tags":["Data"],"summary":"Get Facility Data","description":"Get time series data for a specific facility.\n\nThis endpoint returns time series data for a facility, with data grouped by unit.\nThe data can be aggregated by different time intervals.\n\nArgs:\n network_code: The network the facility belongs to\n facility_code: The facility code to get data for\n metrics: List of metrics to query (e.g. energy, power, emissions)\n interval: The time interval to aggregate by\n date_start: Start time for the query\n date_end: End time for the query\n client: ClickHouse client dependency\n\nReturns:\n APIV4ResponseSchema: Time series data response containing a list of TimeSeries objects,\n one per requested metric, with data for each unit","operationId":"get_facility_data_v4_data_facilities__network_code__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"network_code","in":"path","required":true,"schema":{"type":"string","title":"Network Code"}},{"name":"metrics","in":"query","required":true,"schema":{"type":"array","items":{"$ref":"#/components/schemas/Metric"},"description":"The metrics to get data for","title":"Metrics"},"description":"The metrics to get data for","example":"energy"},{"name":"interval","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Interval","description":"The time interval to aggregate data by","default":"5m"},"description":"The time interval to aggregate data by","example":"1h"},{"name":"facility_code","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"The facility code to get data for","title":"Facility Code"},"description":"The facility code to get data for","example":"AEMO_DISCOS_01"},{"name":"date_start","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Start time for the query","title":"Date Start"},"description":"Start time for the query","example":"2024-01-01T00:00:00"},{"name":"date_end","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"End time for the query","title":"Date End"},"description":"End time for the query","example":"2024-01-02T00:00:00"},{"name":"with_clerk","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"With Clerk"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIV4ResponseSchema"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v4/data/network/{network_code}":{"get":{"tags":["Data"],"summary":"Get Network Data","description":"Get time series data for a network.\n\nThis endpoint returns time series data for a network, with optional grouping\nby region and other dimensions. The data can be aggregated by different time\nintervals.\n\nArgs:\n network_code: The network to get data for\n metrics: List of metrics to query (e.g. energy, power, price)\n interval: The time interval to aggregate by\n date_start: Start time for the query\n date_end: End time for the query\n primary_grouping: Primary grouping to apply\n secondary_grouping: Optional secondary grouping to apply\n client: ClickHouse client dependency\n\nReturns:\n APIV4ResponseSchema: Time series data response containing a list of TimeSeries objects,\n one per requested metric","operationId":"get_network_data_v4_data_network__network_code__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"network_code","in":"path","required":true,"schema":{"type":"string","title":"Network Code"}},{"name":"metrics","in":"query","required":true,"schema":{"type":"array","items":{"$ref":"#/components/schemas/Metric"},"description":"The metrics to get data for","title":"Metrics"},"description":"The metrics to get data for","example":"energy"},{"name":"interval","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Interval","description":"The time interval to aggregate data by","default":"5m"},"description":"The time interval to aggregate data by","example":"1h"},{"name":"date_start","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Start time for the query","title":"Date Start"},"description":"Start time for the query","example":"2024-01-01T00:00:00"},{"name":"date_end","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"End time for the query","title":"Date End"},"description":"End time for the query","example":"2024-01-02T00:00:00"},{"name":"network_region","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Network region to get data for","title":"Network Region"},"description":"Network region to get data for","example":"NSW1"},{"name":"fueltech","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Fueltech to get data for","title":"Fueltech"},"description":"Fueltech to get data for","example":"coal_black"},{"name":"fueltech_group","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Fueltech group to get data for","title":"Fueltech Group"},"description":"Fueltech group to get data for","example":"coal"},{"name":"primary_grouping","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PrimaryGrouping","description":"Primary grouping to apply","default":"network"},"description":"Primary grouping to apply","example":"network_region"},{"name":"secondary_grouping","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/SecondaryGrouping"},{"type":"null"}],"description":"Optional secondary grouping to apply","title":"Secondary Grouping"},"description":"Optional secondary grouping to apply","example":"fueltech_group"},{"name":"with_clerk","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"With Clerk"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIV4ResponseSchema"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v4/facilities/":{"get":{"tags":["Facilities","Facilities"],"summary":"Get Facilities","description":"Get all facilities and their associated units","operationId":"get_facilities_v4_facilities__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"facility_code","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Filter by facility code(s)","title":"Facility Code"},"description":"Filter by facility code(s)"},{"name":"status_id","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/UnitStatusType"}},{"type":"null"}],"description":"Filter by unit status(es)","title":"Status Id"},"description":"Filter by unit status(es)"},{"name":"fueltech_id","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/UnitFueltechType"}},{"type":"null"}],"description":"Filter by unit fuel technology type(s)","title":"Fueltech Id"},"description":"Filter by unit fuel technology type(s)"},{"name":"network_id","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Filter by network code(s)","title":"Network Id"},"description":"Filter by network code(s)"},{"name":"network_region","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by network region","title":"Network Region"},"description":"Filter by network region"},{"name":"with_clerk","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"With Clerk"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIV4ResponseSchema"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v4/market/network/{network_code}":{"get":{"tags":["Market"],"summary":"Get Network Data","description":"Get market data for a network.\n\nThis endpoint returns market data like price and demand, with optional grouping\nby region. The data can be aggregated by different time intervals.\n\nArgs:\n network_code: The network to get data for\n metrics: List of metrics to query (e.g. price, demand)\n interval: The time interval to aggregate by\n date_start: Start time for the query\n date_end: End time for the query\n primary_grouping: Primary grouping to apply\n client: ClickHouse client dependency\n\nReturns:\n APIV4ResponseSchema: Time series data response containing a list of TimeSeries objects,\n one per requested metric","operationId":"get_network_data_v4_market_network__network_code__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"network_code","in":"path","required":true,"schema":{"type":"string","title":"Network Code"}},{"name":"metrics","in":"query","required":true,"schema":{"type":"array","items":{"$ref":"#/components/schemas/Metric"},"description":"The metrics to get data for","title":"Metrics"},"description":"The metrics to get data for","example":"price"},{"name":"interval","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Interval","description":"The time interval to aggregate data by","default":"5m"},"description":"The time interval to aggregate data by","example":"1h"},{"name":"date_start","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Start time for the query","title":"Date Start"},"description":"Start time for the query","example":"2024-01-01T00:00:00"},{"name":"date_end","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"End time for the query","title":"Date End"},"description":"End time for the query","example":"2024-01-02T00:00:00"},{"name":"network_region","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Network region to get data for","title":"Network Region"},"description":"Network region to get data for","example":"NSW1"},{"name":"primary_grouping","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PrimaryGrouping","description":"Primary grouping to apply","default":"network"},"description":"Primary grouping to apply","example":"network_region"},{"name":"with_clerk","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"With Clerk"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIV4ResponseSchema"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v4/me":{"get":{"tags":["User"],"summary":"Get User Me","description":"Get the current user","operationId":"get_user_me_v4_me_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"with_clerk","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"With Clerk"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpennemUserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"APIV4ResponseSchema":{"properties":{"version":{"type":"string","title":"Version"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"success":{"type":"boolean","title":"Success","default":true},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"data":{"items":{},"type":"array","title":"Data","default":[]},"total_records":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Records"}},"type":"object","title":"APIV4ResponseSchema"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"Interval":{"type":"string","enum":["5m","1h","1d","7d","1M","3M","season","1y","fy"],"title":"Interval","description":"Time intervals for aggregating time series data.\n\nThese intervals are used to group time series data into fixed-width periods\nfor both API queries and database aggregations.\n\nAttributes:\n INTERVAL: 5-minute interval (default trading interval)\n HOUR: 1-hour interval\n DAY: Daily interval\n WEEK: 7-day interval\n MONTH: Monthly interval\n QUARTER: Quarterly interval\n SEASON: Seasonal interval (3 months)\n YEAR: Yearly interval\n FINANCIAL_YEAR: Financial year interval (July-June)"},"Metric":{"type":"string","enum":["power","energy","price","market_value","demand","demand_energy","emissions","renewable_proportion"],"title":"Metric","description":"Types of metrics that can be queried in OpenNEM.\n\nEach metric represents a different type of measurement or calculation\nthat can be performed on the data.\n\nAttributes:\n POWER: Instantaneous power output/consumption (MW)\n ENERGY: Energy generated/consumed over time (MWh)\n PRICE: Price per unit of energy ($/MWh)\n DEMAND: Demand for energy (MW)\n MARKET_VALUE: Total market value ($)\n EMISSIONS: CO2 equivalent emissions (tonnes)\n RENEWABLE_PROPORTION: Percentage of renewable energy (%)"},"OpenNEMRoles":{"type":"string","enum":["admin","pro","academic","user","anonymous"],"title":"OpenNEMRoles"},"OpenNEMUser":{"properties":{"id":{"type":"string","title":"Id"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"owner_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner Id"},"plan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan"},"rate_limit":{"anyOf":[{"$ref":"#/components/schemas/OpenNEMUserRateLimit"},{"type":"null"}]},"unkey_meta":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Unkey Meta"},"roles":{"items":{"$ref":"#/components/schemas/OpenNEMRoles"},"type":"array","title":"Roles","default":["anonymous"]},"meta":{"anyOf":[{"$ref":"#/components/schemas/OpennemAPIRequestMeta"},{"type":"null"}]}},"type":"object","required":["id"],"title":"OpenNEMUser"},"OpenNEMUserRateLimit":{"properties":{"limit":{"type":"integer","title":"Limit"},"remaining":{"type":"integer","title":"Remaining"},"reset":{"anyOf":[{"type":"string","format":"date-time"},{"type":"integer"}],"title":"Reset"}},"type":"object","required":["limit","remaining","reset"],"title":"OpenNEMUserRateLimit"},"OpennemAPIRequestMeta":{"properties":{"remaining":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Remaining"},"reset":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Reset"}},"type":"object","title":"OpennemAPIRequestMeta"},"OpennemUserResponse":{"properties":{"version":{"type":"string","title":"Version"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"success":{"type":"boolean","title":"Success","default":true},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"data":{"$ref":"#/components/schemas/OpenNEMUser"},"total_records":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Records"}},"type":"object","required":["data"],"title":"OpennemUserResponse"},"PrimaryGrouping":{"type":"string","enum":["network","network_region"],"title":"PrimaryGrouping","description":"Primary grouping types for time series data.\n\nThese groupings are network-based and determine the base level of aggregation.\n\nAttributes:\n NETWORK: Group by network only (default)\n NETWORK_REGION: Group by network regions (e.g., QLD1, NSW1)"},"SecondaryGrouping":{"type":"string","enum":["fueltech","fueltech_group","status","renewable"],"title":"SecondaryGrouping","description":"Secondary grouping types for time series data.\n\nThese groupings can be applied on top of the primary grouping to provide\nadditional dimensionality to the data.\n\nAttributes:\n FUELTECH: Group by individual fuel technologies\n FUELTECH_GROUP: Group by fuel technology groups (e.g., coal, gas, solar)\n STATUS: Group by facility status (e.g., operating, retired)\n RENEWABLE: Group by renewable vs non-renewable"},"UnitFueltechType":{"type":"string","enum":["battery","battery_charging","battery_discharging","bioenergy_biogas","bioenergy_biomass","coal_black","coal_brown","distillate","gas_ccgt","gas_ocgt","gas_recip","gas_steam","gas_wcmg","hydro","pumps","solar_rooftop","solar_thermal","solar_utility","nuclear","other","solar","wind","wind_offshore","imports","exports","interconnector","aggregator_vpp","aggregator_dr"],"title":"UnitFueltechType"},"UnitStatusType":{"type":"string","enum":["committed","operating","retired"],"title":"UnitStatusType"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}