This python script retrieves data from the Danish Datahub. The API is well documented here and has a swagger here, so it is rather simple to use.
To get started you need to create a refresh token on Energinet. See relevant instructions on the website. The refresh token is valid for one year.