kipe / nordpool

Python library for fetching Nord Pool spot prices.
MIT License
105 stars 39 forks source link

This Lib just stopped working? #36

Closed eriklilljequist closed 1 month ago

eriklilljequist commented 1 month ago

I guess nordpool changed their URLs today at 15.00 CET? atleast the request to https://www.nordpoolgroup.com/api/marketdata/page/%i returns a 404 not found.

likely this should be the new one: "https://dataportal-api.nordpoolgroup.com/api/"

Is there any active support for this library and will you in that case update?

kipe commented 1 month ago

Yes, I'll update this at somepoint, as I'm using this library myself as well. PR is very welcome though, quite busy with work at the moment.

terop commented 1 month ago

I had a brief look on the new Nord Pool API and it's not just updating the URL as the data format has changed. I may take a shot at this some point but I won't make any promises.

aviborg commented 1 month ago

Seems the new API has this format:

https://dataportal-api.nordpoolgroup.com/api/DayAheadPrices?date=2024-10-14&market=DayAhead&deliveryArea=SE3&currency=SEK

eriklilljequist commented 1 month ago

I will submit an MR/PR for the spot-prices in a few hours.

kipe commented 1 month ago

@eriklilljequist If you haven't already started, I'll do this now. Kinda need tomorrows prices for my automation :D

eriklilljequist commented 1 month ago

I have it finished. for the elspot. Just need to put the kids to bed

kipe commented 1 month ago

Damn, just finished myself and I'm just writing the tests for it.

eriklilljequist commented 1 month ago

good job

eriklilljequist commented 1 month ago

I basically copied the adaptations done in the HASS integration. So I did not need to put much work into it.

eriklilljequist commented 1 month ago

I have it inlined in my IOT platform since lunch, working just fine, next step was the PR to you :)

kipe commented 1 month ago
{'areas': {'FI': [{'end': datetime.datetime(2024, 10, 14, 23, 0, tzinfo=tzutc()),
                   'start': datetime.datetime(2024, 10, 14, 22, 0, tzinfo=tzutc()),
                   'value': 45.13},
                  {'end': datetime.datetime(2024, 10, 15, 0, 0, tzinfo=tzutc()),
                   'start': datetime.datetime(2024, 10, 14, 23, 0, tzinfo=tzutc()),
                   'value': 27.31},
                  {'end': datetime.datetime(2024, 10, 15, 1, 0, tzinfo=tzutc()),
                   'start': datetime.datetime(2024, 10, 15, 0, 0, tzinfo=tzutc()),
                   'value': 25.68},
                  {'end': datetime.datetime(2024, 10, 15, 2, 0, tzinfo=tzutc()),
                   'start': datetime.datetime(2024, 10, 15, 1, 0, tzinfo=tzutc()),
                   'value': 16.71},
                  {'end': datetime.datetime(2024, 10, 15, 3, 0, tzinfo=tzutc()),
                   'start': datetime.datetime(2024, 10, 15, 2, 0, tzinfo=tzutc()),
                   'value': 12.04},
                  {'end': datetime.datetime(2024, 10, 15, 4, 0, tzinfo=tzutc()),
                   'start': datetime.datetime(2024, 10, 15, 3, 0, tzinfo=tzutc()),
                   'value': 26.56},
                  {'end': datetime.datetime(2024, 10, 15, 5, 0, tzinfo=tzutc()),
                   'start': datetime.datetime(2024, 10, 15, 4, 0, tzinfo=tzutc()),
                   'value': 48.5},
                  {'end': datetime.datetime(2024, 10, 15, 6, 0, tzinfo=tzutc()),
                   'start': datetime.datetime(2024, 10, 15, 5, 0, tzinfo=tzutc()),
                   'value': 129.35},
                  {'end': datetime.datetime(2024, 10, 15, 7, 0, tzinfo=tzutc()),
                   'start': datetime.datetime(2024, 10, 15, 6, 0, tzinfo=tzutc()),
                   'value': 122.86},
                  {'end': datetime.datetime(2024, 10, 15, 8, 0, tzinfo=tzutc()),
                   'start': datetime.datetime(2024, 10, 15, 7, 0, tzinfo=tzutc()),
                   'value': 106.38},
                  {'end': datetime.datetime(2024, 10, 15, 9, 0, tzinfo=tzutc()),
                   'start': datetime.datetime(2024, 10, 15, 8, 0, tzinfo=tzutc()),
                   'value': 59.51},
                  {'end': datetime.datetime(2024, 10, 15, 10, 0, tzinfo=tzutc()),
                   'start': datetime.datetime(2024, 10, 15, 9, 0, tzinfo=tzutc()),
                   'value': 48.38},
                  {'end': datetime.datetime(2024, 10, 15, 11, 0, tzinfo=tzutc()),
                   'start': datetime.datetime(2024, 10, 15, 10, 0, tzinfo=tzutc()),
                   'value': 35.0},
                  {'end': datetime.datetime(2024, 10, 15, 12, 0, tzinfo=tzutc()),
                   'start': datetime.datetime(2024, 10, 15, 11, 0, tzinfo=tzutc()),
                   'value': 27.24},
                  {'end': datetime.datetime(2024, 10, 15, 13, 0, tzinfo=tzutc()),
                   'start': datetime.datetime(2024, 10, 15, 12, 0, tzinfo=tzutc()),
                   'value': 28.13},
                  {'end': datetime.datetime(2024, 10, 15, 14, 0, tzinfo=tzutc()),
                   'start': datetime.datetime(2024, 10, 15, 13, 0, tzinfo=tzutc()),
                   'value': 35.0},
                  {'end': datetime.datetime(2024, 10, 15, 15, 0, tzinfo=tzutc()),
                   'start': datetime.datetime(2024, 10, 15, 14, 0, tzinfo=tzutc()),
                   'value': 45.52},
                  {'end': datetime.datetime(2024, 10, 15, 16, 0, tzinfo=tzutc()),
                   'start': datetime.datetime(2024, 10, 15, 15, 0, tzinfo=tzutc()),
                   'value': 30.0},
                  {'end': datetime.datetime(2024, 10, 15, 17, 0, tzinfo=tzutc()),
                   'start': datetime.datetime(2024, 10, 15, 16, 0, tzinfo=tzutc()),
                   'value': 38.66},
                  {'end': datetime.datetime(2024, 10, 15, 18, 0, tzinfo=tzutc()),
                   'start': datetime.datetime(2024, 10, 15, 17, 0, tzinfo=tzutc()),
                   'value': 27.73},
                  {'end': datetime.datetime(2024, 10, 15, 19, 0, tzinfo=tzutc()),
                   'start': datetime.datetime(2024, 10, 15, 18, 0, tzinfo=tzutc()),
                   'value': 20.24},
                  {'end': datetime.datetime(2024, 10, 15, 20, 0, tzinfo=tzutc()),
                   'start': datetime.datetime(2024, 10, 15, 19, 0, tzinfo=tzutc()),
                   'value': 20.05},
                  {'end': datetime.datetime(2024, 10, 15, 21, 0, tzinfo=tzutc()),
                   'start': datetime.datetime(2024, 10, 15, 20, 0, tzinfo=tzutc()),
                   'value': 14.07},
                  {'end': datetime.datetime(2024, 10, 15, 22, 0, tzinfo=tzutc()),
                   'start': datetime.datetime(2024, 10, 15, 21, 0, tzinfo=tzutc()),
                   'value': 10.16}]},
 'currency': 'EUR',
 'end': datetime.datetime(1970, 1, 1, 0, 0, tzinfo=<UTC>),
 'start': datetime.datetime(2024, 10, 14, 22, 0, tzinfo=tzutc()),
 'updated': datetime.datetime(2024, 10, 14, 11, 17, 1, 454046, tzinfo=tzutc())}

Just to double check that I haven't missed anything, this looks like the correct response from Elspot.fetch, right?

mplattu commented 1 month ago

Thanks for the update!

kipe commented 1 month ago

No worries, let me know if something pops up still. Didn't test for example other currencies, not sure if they work.

As 0.4.0 is now released, closing this issue.