Download category tree from API
Currently the category tree of CSO is hard-coded.
The API of CSO provides a navigation API with the read
and search
methods.
The download script should download that data in source-data
and the convert script should create the category tree from this data.
JSON-RPC API
Here are some examples to call the CSO API which is JSON-RPC based :
curl 'https://ws.cso.ie/public/api.jsonrpc' \
-H 'Accept: application/json' \
-H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' \
--data-raw '{"jsonrpc":"2.0","method":"PxStat.System.Navigation.Navigation_API.Read","params":{"LngIsoCode":"en"},"id":29391857}' \
--compressed
curl 'https://ws.cso.ie/public/api.jsonrpc' \
-H 'Accept: application/json' \
-H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' \
--data-raw '{"jsonrpc":"2.0","method":"PxStat.System.Navigation.Navigation_API.Search","params":{"PrcCode":"na","LngIsoCode":"en"},"id":567059378}' \
--compressed