diff --git a/README.md b/README.md new file mode 100644 index 0000000..4a99c1b --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +# Destatis Genesis + +This Project aims to provide a client the destatis genesis rest api. + +It has been introduced to download specific data, as the web UI didn't work. +As of now the UI has been fixed. Due to that fix, this project hasn't reached an working state. + +Documentation can be found here: +[Doc](https://www-genesis.destatis.de/datenbank/online/docs/GENESIS-Webservices_Einfuehrung.pdf) +[Examples](https://www-genesis.destatis.de/datenbank/online/docs/20250505_python_post_logincheck_tablefile_cubefile.pdf) diff --git a/job-get.sh b/job-get.sh new file mode 100755 index 0000000..e13bc2d --- /dev/null +++ b/job-get.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +source ./.env + +BASE_URL=https://www-genesis.destatis.de/genesisWS/rest/2020 + +curl -X POST "$BASE_URL/catalogue/jobs" \ + -H "Content-Type: application/x-www-form-urlencoded" \ + -H "username: $DESTATIS_TOKEN" \ + -d "selection=" \ + -d "searchcriterion=status" \ + -d "sortcriterion=status" \ + -d "area=all" \ + -d "type=all" \ + | jq diff --git a/job-start.sh b/job-start.sh new file mode 100755 index 0000000..b2c7378 --- /dev/null +++ b/job-start.sh @@ -0,0 +1,42 @@ +#!/bin/sh + +source ./.env + +BASE_URL=https://www-genesis.destatis.de/genesisWS/rest/2020 + +# curl -X POST "$BASE_URL/helloworld/logincheck" \ +# -H "Content-Type: application/x-www-form-urlencoded" \ +# -H "username: c7a23d31ee1b4af6bc30c5c49840e57b" \ + +curl -X POST "$BASE_URL/data/tablefile" \ + -H "Content-Type: application/x-www-form-urlencoded" \ + -H "username: $DESTATIS_TOKEN" \ + -d "name=23131-0002" \ + -d "startyear=2010" \ + -d "endyear=2012" \ + -d "compress=true" \ + -d "job=true" \ + -d "format=csv" \ + -d "language=de" \ + --output start-job.json + +# curl -X POST "$BASE_URL/data/tablefile" \ +# -H "Content-Type: application/x-www-form-urlencoded" \ +# -H "username: $DESTATIS_TOKEN" \ +# -d "name=23131-0002_625860825" \ +# -d "area=Alle" \ +# --output output.zip + +# curl -X POST "$BASE_URL/catalogue/results" \ +# -H "Content-Type: application/x-www-form-urlencoded" \ +# -H "username: $DESTATIS_TOKEN" + +# curl -X POST "$BASE_URL/catalogue/results" \ +# -H "Content-Type: application/x-www-form-urlencoded" \ +# -H "username: $DESTATIS_TOKEN" + +# curl -X POST "$BASE_URL/catalogue/jobs" \ +# -H "Content-Type: application/x-www-form-urlencoded" \ +# -H "username: $DESTATIS_TOKEN" \ +# -d "selection=*" +# diff --git a/logincheck.sh b/logincheck.sh deleted file mode 100755 index 4437a57..0000000 --- a/logincheck.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -BASE_URL=https://www-genesis.destatis.de/genesisWS/rest/2020 - -# curl -X POST "$BASE_URL/helloworld/logincheck" \ -# -H "Content-Type: application/x-www-form-urlencoded" \ -# -H "username: c7a23d31ee1b4af6bc30c5c49840e57b" \ - -curl -X POST "$BASE_URL/data/tablefile" \ - -H "Content-Type: application/x-www-form-urlencoded" \ - -H "username: $DESTATIS_TOKEN" \ - -d "name=61111-0004" \ - -d "startyear=2025" \ - -d "transpose=true" \ - -d "classifyingvariable1=C13A5" \ - -d "classifyingkey1=CC13-071*" \ - -d "compress=true" \ - -d "format=csv" \ - -d "language=de" -