Loadshedding API?

Marco3601

New Member
Joined
Oct 31, 2015
Messages
9
Hey everyone, Can someone explain maybe where Eskomsepush gets their data from? From all the articles I have read they mention it's their parttime job and that they get information from online resources, but closer look city power does not provide certain locations that do fall under Johannesburg and even if they do the schedules don't align with their data. The same goes for the loadshedding.eskom.co.za site, schedules aren't the same at all. What gives?
 

Traq

Well-Known Member
Joined
Aug 22, 2012
Messages
467
Hey everyone, Can someone explain maybe where Eskomsepush gets their data from? From all the articles I have read they mention it's their parttime job and that they get information from online resources, but closer look city power does not provide certain locations that do fall under Johannesburg and even if they do the schedules don't align with their data. The same goes for the loadshedding.eskom.co.za site, schedules aren't the same at all. What gives?

They are likely pulling the data from multiple sources (municipalities, cities, Eskom schedule) and then combining it on a best guess.

No choice really, I have some python running doing the same, and it is messy. That being said, this is mostly for me trying out something which I am not too proficiant at, and learning as I go.
 

Marco3601

New Member
Joined
Oct 31, 2015
Messages
9
They are likely pulling the data from multiple sources (municipalities, cities, Eskom schedule) and then combining it on a best guess.

No choice really, I have some python running doing the same, and it is messy. That being said, this is mostly for me trying out something which I am not too proficiant at, and learning as I go.

But I have looked everywhere for my suburb and I can't find it publically available anywhere at all. But the app has the schedule and is pretty accurate so it's kind of confusing, to be honest.
 

Steamy Tom

Executive Member
Joined
Jan 23, 2019
Messages
7,395
But I have looked everywhere for my suburb and I can't find it publically available anywhere at all. But the app has the schedule and is pretty accurate so it's kind of confusing, to be honest.

if you were to jot down your schedule a few times when it came up a pattern would appear...
 

Geoff.D

Honorary Master
Joined
Aug 4, 2005
Messages
21,954
Hey everyone, Can someone explain maybe where Eskomsepush gets their data from? From all the articles I have read they mention it's their parttime job and that they get information from online resources, but closer look city power does not provide certain locations that do fall under Johannesburg and even if they do the schedules don't align with their data. The same goes for the loadshedding.eskom.co.za site, schedules aren't the same at all. What gives?

What area and suburb are you in?
 

juriedutoit

New Member
Joined
Jun 5, 2021
Messages
2
Ok so I got stuck into this today for a community website. Feel free to edit the following. Replace anything in <> with the relevant value.

Get the current status (as posted earlier):

Call: http://loadshedding.eskom.co.za/LoadShedding/GetStatus
Returned data: Is a single character/value. If less than 1 then discard. If more or equal subtract 1 for the current stage.
Example: 1 = No load shedding, 2 = Stage 1, 5 = Stage 4

Get the schedule:

Province IDs:
1 = Eastern Cape
2 = Free State
3 = Gauteng
4 = KwaZulu-Natal
5 = Limpopo
6 = Mpumalanga
7 = North West
8 = Northern Cape
9 = Western Cape

List municipalitied in province:
Call: http://loadshedding.eskom.co.za/LoadShedding/GetMunicipalities/?Id=<province_id>
Example (Province = Western Cape): http://loadshedding.eskom.co.za/LoadShedding/GetMunicipalities/?Id=9
Returned JSON:
Code:
[{"Selected":false,"Text":"Beaufort West","Value":"10237"},{"Selected":false,"Text":"Bergrivier","Value":"10238"},{"Selected":false,"Text":"Bitou","Value":"10239"},{"Selected":false,"Text":"Breede Valley","Value":"10240"},{"Selected":false,"Text":"Cape Agulhas","Value":"10241"},{"Selected":false,"Text":"Cederberg","Value":"10242"},{"Selected":false,"Text":"City of Cape Town","Value":"10243"},{"Selected":false,"Text":"Drakenstein","Value":"10244"},{"Selected":false,"Text":"George","Value":"10245"},{"Selected":false,"Text":"Hessequa","Value":"10246"},{"Selected":false,"Text":"Kannaland","Value":"10247"},{"Selected":false,"Text":"Knysna","Value":"10248"},{"Selected":false,"Text":"Laingsburg","Value":"10249"},{"Selected":false,"Text":"Langeberg","Value":"10250"},{"Selected":false,"Text":"Matzikama","Value":"10251"},{"Selected":false,"Text":"Mossel Bay","Value":"10252"},{"Selected":false,"Text":"Oudtshoorn","Value":"10253"},{"Selected":false,"Text":"Overstrand","Value":"10254"},{"Selected":false,"Text":"Prince Albert","Value":"10255"},{"Selected":false,"Text":"Saldanha Bay","Value":"10256"},{"Selected":false,"Text":"Stellenbosch","Value":"10257"},{"Selected":false,"Text":"Swartland","Value":"10258"},{"Selected":false,"Text":"Swellendam","Value":"10259"},{"Selected":false,"Text":"Theewaterskloof","Value":"10260"},{"Selected":false,"Text":"Witzenberg","Value":"10261"}]

List suburbs of municipality:
Call: http://loadshedding.eskom.co.za/LoadShedding/GetSurburbData/?pageSize=100&pageNum=1&id=<municipality_id>
Example (Municipality = Overstrand): http://loadshedding.eskom.co.za/LoadShedding/GetSurburbData/?pageSize=100&pageNum=1&id=10254
- include the pageSize and pageNum parameters or the call will fail.
Returned JSON:
Code:
{"Total":111,"Results":[{"id":"1061253","text":"Afdak","Tot":267},{"id":"1069253","text":"Albertyn","Tot":535},{"id":"1061254","text":"Avila","Tot":0},{"id":"1061255","text":"Avoca","Tot":268},{"id":"1061256","text":"Baardskeerdersbos","Tot":268},{"id":"1061257","text":"Betty\u0027s Bay","Tot":268},{"id":"1061258","text":"Birkenhead","Tot":0},{"id":"1061259","text":"Blompark","Tot":0},{"id":"1061260","text":"Boesmansrivier","Tot":268},{"id":"1061261","text":"Bovendrift","Tot":268},{"id":"1061262","text":"Braemar","Tot":268},{"id":"1061263","text":"Bruinklip","Tot":268},{"id":"1061264","text":"Buffeljacht","Tot":272},{"id":"1069254","text":"Dagbreek","Tot":534},{"id":"1069255","text":"De Hoop","Tot":267},{"id":"1061265","text":"De Kelders","Tot":0},{"id":"1061266","text":"De Kelders 2","Tot":0},{"id":"1061267","text":"De Kelders 3","Tot":0},{"id":"1069256","text":"Denniston","Tot":267},{"id":"1061268","text":"Die Dam","Tot":272},{"id":"1061269","text":"Dirkuyskraal","Tot":272},{"id":"1061270","text":"Doringbosch","Tot":268},{"id":"1061271","text":"Duinefontein","Tot":0},{"id":"1061272","text":"Eluxolweni","Tot":0},{"id":"1061273","text":"Ertjiesvlei","Tot":268},{"id":"1061274","text":"Fisantskraal","Tot":272},{"id":"1061275","text":"Fisherhaven","Tot":267},{"id":"1061276","text":"Franskraal Strand","Tot":268},{"id":"1061277","text":"Gans Bay","Tot":536},{"id":"1061278","text":"Goedetrouw","Tot":268},{"id":"1061279","text":"Groenewaldskema","Tot":0},{"id":"1061280","text":"Groot Hagelkraal","Tot":0},{"id":"1061281","text":"Grootbos","Tot":268},{"id":"1061282","text":"Grootvlei","Tot":268},{"id":"1061283","text":"Hagelkraal","Tot":0},{"id":"1061284","text":"Hangklip","Tot":268},{"id":"1061285","text":"Hawston","Tot":0},{"id":"1061286","text":"Helderfontein","Tot":0},{"id":"1061287","text":"Hermanus","Tot":2412},{"id":"1061288","text":"Hermanus Outlying","Tot":0},{"id":"1061289","text":"High Noon","Tot":267},{"id":"1061290","text":"Honigsklip","Tot":268},{"id":"1061291","text":"Hoopjesrivier","Tot":267},{"id":"1061292","text":"Houhoek","Tot":267},{"id":"1061293","text":"Karwyderskraal","Tot":268},{"id":"1061294","text":"Kleinbaai","Tot":0},{"id":"1061295","text":"Kleinmond","Tot":536},{"id":"1061296","text":"Kleinrivierkloof","Tot":268},{"id":"1061297","text":"Klipfontein","Tot":0},{"id":"1061298","text":"Koksrivier","Tot":272},{"id":"1061299","text":"Kouderivier","Tot":268},{"id":"1061300","text":"Kouevlakte","Tot":268},{"id":"1069257","text":"Kromvlei","Tot":267},{"id":"1061301","text":"Lamloch","Tot":268},{"id":"1061302","text":"Langkloof","Tot":0},{"id":"1061303","text":"Le Mercy","Tot":268},{"id":"1069258","text":"Lebanon","Tot":267},{"id":"1061304","text":"LObos","Tot":0},{"id":"1061305","text":"Masakhane","Tot":0},{"id":"1061306","text":"Modderrivier","Tot":268},{"id":"1061307","text":"Moeraskloof","Tot":268},{"id":"1061308","text":"Mosselrivier","Tot":0},{"id":"1061309","text":"Mount Pleasant","Tot":0},{"id":"1061310","text":"New Granton","Tot":268},{"id":"1061311","text":"Nuwedam","Tot":268},{"id":"1061312","text":"Nuwepos","Tot":268},{"id":"1061313","text":"Onrus","Tot":535},{"id":"1061314","text":"Oudebosch","Tot":268},{"id":"1061315","text":"Paardenberg","Tot":268},{"id":"1061316","text":"Papiesvlei","Tot":268},{"id":"1061317","text":"Pearly Beach","Tot":0},{"id":"1061318","text":"Perlemoenbaai","Tot":0},{"id":"1061319","text":"Pringle Bay","Tot":268},{"id":"1061320","text":"Protea","Tot":0},{"id":"1061321","text":"Ratelrivier","Tot":272},{"id":"1061322","text":"Rooiels Bay","Tot":268},{"id":"1069259","text":"Salandra","Tot":268},{"id":"1061323","text":"Sandbaai","Tot":268},{"id":"1061324","text":"Sandberg","Tot":268},{"id":"1069260","text":"Sandfontein","Tot":272},{"id":"1061325","text":"Sandhoogte","Tot":268},{"id":"1061326","text":"Sandy\u0027s Glen","Tot":268},{"id":"1061327","text":"Silversands","Tot":268},{"id":"1061328","text":"Somerset West NU","Tot":0},{"id":"1061329","text":"Spookfontein","Tot":536},{"id":"1061330","text":"Stanford","Tot":804},{"id":"1061331","text":"Stompieskloof","Tot":0},{"id":"1061332","text":"Strands Kloof","Tot":268},{"id":"1061333","text":"Sunny Seas Estate","Tot":268},{"id":"1061334","text":"Sunnydale","Tot":804},{"id":"1061335","text":"The Springs","Tot":0},{"id":"1061336","text":"Tierfontein","Tot":268},{"id":"1061337","text":"Tweefontein","Tot":268},{"id":"1061338","text":"Uilenkraal","Tot":268},{"id":"1061339","text":"Uilenkraalsmond","Tot":268},{"id":"1061340","text":"Uitkoms","Tot":268},{"id":"1061341","text":"Van Dyksbaai","Tot":0},{"id":"1061342","text":"Vermont","Tot":267},{"id":"1061343","text":"Viljoenshof","Tot":272},{"id":"1069261","text":"Vredendal","Tot":268}]}
- If Tot is 0 then there won't be further data.

List load shedding schedule for suburb:
Call: http://loadshedding.eskom.co.za/LoadShedding/GetScheduleM/<suburb_id>/<stage>/<province_id>/<municipality_total>
- municipality_total must be 1 or more.
Example (Suburb = Hermanus, Stage = 2, Province = 9 (Western Cape)): http://loadshedding.eskom.co.za/LoadShedding/GetScheduleM/1061287/2/9/1
Returned HTML (you will need to parse this):

Wed, 08 Jan

18:00 - 20:30


Thu, 09 Jan

00:00 - 02:30


Fri, 10 Jan

00:00 - 02:30

08:00 - 10:30
Hi, Most of the suburbs I am interrested in has "0", so I cannot get the HTML with the time slots. Any idea why most of the suburbs has a "0"? Is there perhaps someone one can contact to find out why there is no data for most suburbs?
 

Benedict A55h0le

Expert Member
Joined
Oct 21, 2020
Messages
1,291
Don`t need an api or scraping, CPT load-shedding schedule is planned by 2 stoners in Noordhoek.
 

juriedutoit

New Member
Joined
Jun 5, 2021
Messages
2
Maybe they are grouped together. Like 8-10 suburbs will have the same loadshedding so you have to see what group the are placed in. Maybe just thinking out loud.

I am currently developing an API for several months now so this is all on going for me the whole api thing. See if perhaps a parameter is missing or required instead of the suburb.
Thanks.
 
Top