GENESIS-Online is the data portal of the Federal Statistical Office of Germany (Statistisches Bundesamt). Problem Since Destatis shut down the option to send GET-requests to their API, it is now impossible to get data from the API into Excel or PowerBI without using a custom connector. The core of the problem is that the way authentication via "content" in a POST request is not allowed from PowerQuery Web.Contents (that is how Genesis demands the auth) and HTTPS-authentication is not supported by the Genesis Web API (that seems to be what is supported by Microsoft). Solution There are only two viable solutions to this from a enduser perspective: Either Destatis or Microsoft changes the way authentication works to allow for Web.Contents to work or Destatis develops and issues a certified connector via Microsoft. Code-Example that worked until GET was removed from the API let
URL = "https://www-genesis.destatis.de/genesisWS/rest/2020/data/table?" &
Uri.BuildQueryString(
[
username = "YourUsernameOrToken",
password = "YourPasswordOrEmptyWhenToken",
name = "61111-0002",
area = "all",
compress = "false",
startyear = "2020",
endyear = "2023",
regionalvariable = "",
regionalkey ="",
classifyingvariable1="",
classifyingkey1="",
classifyingvariable2="",
classifyingkey2="",
job = Text.From(false,"en-US"),
stand="",
language="de"
]),
Quelle = Json.Document(Web.Contents(URL)),
Object = Quelle[Object],
Content = Object[Content],
Tbl = Csv.Document(Content,[Delimiter=";", Columns=5, Encoding=65001, QuoteStyle=QuoteStyle.None])
in
Tbl
... View more