@@ -37,16 +37,16 @@ Tables on EU policy
37
37
38
38
Connect to the JSON-stat Eurostat API to retrieve dataset ** tesem120** :
39
39
40
- https://ec.europa.eu/eurostat/wdds/rest/data/v2.1/json/en/ tesem120?precision=1
40
+ https://ec.europa.eu/eurostat/api/dissemination/statistics/1.0/data/ tesem120
41
41
42
42
You can view the contents of the dataset at
43
43
44
- https://jsonstat.com/explorer/#/https%3A%2F%2Fec.europa.eu%2Feurostat%2Fwdds%2Frest%2Fdata%2Fv2.1%2Fjson%2Fen% 2Ftesem120%3Fprecision%3D1
44
+ https://jsonstat.com/explorer/#/https%3A%2F%2Fec.europa.eu%2Feurostat%2Fapi%2Fdissemination%2Fstatistics%2F1.0%2Fdata% 2Ftesem120
45
45
46
46
To download the dataset from the command line using Eurostat's API, run [ cURL] ( https://curl.haxx.se/dlwiz/?type=bin ) :
47
47
48
48
```
49
- curl "https://ec.europa.eu/eurostat/wdds/rest/data/v2.1/json/en/ tesem120?precision=1 " -o eurostat.jsonstat
49
+ curl "https://ec.europa.eu/eurostat/api/dissemination/statistics/1.0/data/ tesem120" -o eurostat.jsonstat
50
50
```
51
51
52
52
JSON-stat keeps data and metadata completely apart because it is designed to be an efficient transport format. That probably makes it human-unfriendly. Fortunately, we can use jsonstat-conv to convert JSON-stat to other formats.
@@ -195,7 +195,7 @@ json2csv < eurostat-comma.json > eurostat-semi.csv -w ";"
195
195
All the process has required three lines and three files (_ eurostat.jsonstat_ , _ eurostat-drop.json_ , _ eurostat.csv_ ):
196
196
197
197
```
198
- curl "https://ec.europa.eu/eurostat/wdds/rest/data/v2.1/json/en/ tesem120?precision=1 " -o eurostat.jsonstat
198
+ curl "https://ec.europa.eu/eurostat/api/dissemination/statistics/1.0/data/ tesem120" -o eurostat.jsonstat
199
199
200
200
jsonstatdice eurostat.jsonstat eurostat-subset.jsonstat --filter sex=T,age=Y15-74,unit=PC_ACT
201
201
@@ -221,19 +221,19 @@ jsonstat2arrobj < eurostat.jsonstat > eurostat.json --stream
221
221
So to get a comma-delimited CSV with dot as the decimal mark in a single line:
222
222
223
223
```
224
- curl "https://ec.europa.eu/eurostat/wdds/rest/data/v2.1/json/en/ tesem120?precision=1 " | jsonstatdice --filter sex=T,age=Y15-74,unit=PC_ACT --stream | jsonstat2arrobj --by geo --drop sex,age,unit --stream | json2csv > eurostat.csv
224
+ curl "https://ec.europa.eu/eurostat/api/dissemination/statistics/1.0/data/ tesem120" | jsonstatdice --filter sex=T,age=Y15-74,unit=PC_ACT --stream | jsonstat2arrobj --by geo --drop sex,age,unit --stream | json2csv > eurostat.csv
225
225
```
226
226
227
227
Or a little shorter:
228
228
229
229
```
230
- curl "https://ec.europa.eu/eurostat/wdds/rest/data/v2.1/json/en/ tesem120?precision=1 " | jsonstatdice -f sex=T,age=Y15-74,unit=PC_ACT -t | jsonstat2arrobj -b geo -d sex,age,unit -t | json2csv > eurostat.csv
230
+ curl "https://ec.europa.eu/eurostat/api/dissemination/statistics/1.0/data/ tesem120" | jsonstatdice -f sex=T,age=Y15-74,unit=PC_ACT -t | jsonstat2arrobj -b geo -d sex,age,unit -t | json2csv > eurostat.csv
231
231
```
232
232
233
233
And to get a semicolon-delimited CSV with comma as the decimal mark:
234
234
235
235
```
236
- curl "https://ec.europa.eu/eurostat/wdds/rest/data/v2.1/json/en/ tesem120?precision=1 " | jsonstatdice -f sex=T,age=Y15-74,unit=PC_ACT -t | jsonstat2arrobj -b geo -d sex,age,unit -k -t | json2csv > eurostat-semi.csv -w ";"
236
+ curl "https://ec.europa.eu/eurostat/api/dissemination/statistics/1.0/data/ tesem120" | jsonstatdice -f sex=T,age=Y15-74,unit=PC_ACT -t | jsonstat2arrobj -b geo -d sex,age,unit -k -t | json2csv > eurostat-semi.csv -w ";"
237
237
```
238
238
239
239
## A UNECE Example
0 commit comments