Embedding open data

The CKAN Embed extension shown above in a screenshot from the OGD Handbook, allows you to write a simple search query and get HTML code to put into your web page that always presents the latest results. More sophisticated queries are explained on GitHub, while the Handbook chapter also explains other ways of embedding content, such as the OpenGraph Cards supported on this forum. These are still not available on opendata.swiss, but supported elsewhere, e.g.:

The CKAN Embed is a side project I did a couple of years ago, which continues to be used on a couple of web sites - notably the Linked Data Service portal (currently offline), the Canton of Thurgau, and to recommend open data for Opendata.ch hackathons. The widget allows embedding the live search results from a CKAN open data portal search. This way people do not need to leave your website to discover what kind of fresh data is available on a particular topic, or from your organization.

It was also a foray into getting to know CKAN, learning about its APIs, and contributing back some open source. The widget is based on ckan.js which actually makes it quite easy for any JavaScript developer to connect to CKAN portals - as long as they allow cross-site requests (if they don’t, you’ll need to run a server or proxy). The way the widget works, and some alternative solutions, are presented in the OGD Handbook and on the GitHub repo.

I did a small update to the code recently and opened a couple of tickets if you’d be interested in helping out:

The Canton of Zürich also very recently put up beta version up of a dataset explorer, which works in a similar fashion:

Notice the correct link to the beta above is https://www.web.statistik.zh.ch/datenkatalog/#/