Closed ThomasRegier closed 1 year ago
The error shows that the site is blocking your request. I guess they are using a cookie (or a combination of multiple cookies) to block direct access to the download endpoint. The download page sets these four cookies: They're probably used to identify valid requests. A workaround could be to send a get request to the aforementioned download page to get the cookies to be used in the post request.
@lukaspanni thank you for your help.
I already found the error and do already built my data pipeline and analysis. I did not copy the complete payload. Here is a complete description of the issue and the solution: https://stackoverflow.com/questions/73219857/perform-download-via-download-button-when-request-url-in-browser-inspect-does-no/73743659#73743659
Btw: The data quality does seem to be not that great. Especially if I want to build a check comparing electricity production with consumption, storage use and export I do get errors of up to more than 3 gwh per hour.
I just posted in issue #7 how the example in /smard-api)/python-client/ fails. But why even need a special library if the use case is quit usual.
I simply want to download the file I may get with the download button on the following smard.de-link:
https://www.smard.de/home/downloadcenter/download-marktdaten#!?downloadAttributes=%7B%22selectedCategory%22:1,%22selectedSubCategory%22:1,%22selectedRegion%22:%22DE%22,%22from%22:1658872800000,%22to%22:1659563999999,%22selectedFileType%22:%22CSV%22%7D
Based on the site traffic I found out, that the following url and payload are used:
Usually I should be able to perform this request:
But I receive the following error:
How may this be solved?