API get modified/updated addresses

43 views
Skip to first unread message

Lucca Kaiser

unread,
Jun 3, 2022, 9:32:22 AM6/3/22
to GeoAdminCh API
Hi

I'm using the csv file from https://data.geo.admin.ch/ch.bfs.gebaeude_wohnungs_register to get addresses. Is there a way to get all recently modified (incl. newly created) addresses via API? This way I could keep the data up to date without having to re-import the whole csv periodically.

With the following request I can get daily modified addresses, but unfortunately it is limited to 201 and offset seems not available:


Thank you and best regards,
Lucca

Pasquale Di Donato

unread,
Jun 3, 2022, 11:15:54 AM6/3/22
to GeoAdminCh API
Dear Lucca,

you could get the list of modified addresses (from the layer ch.swisstopo.amtliches_gebaeudeadressverzeichnis) from our Linked Data service, e.g.


If you need some json you could try something like:

  -H 'accept: application/sparql-results+json' \

  -H 'content-type: application/x-www-form-urlencoded; charset=UTF-8' \

  -H 'origin: https://geo.ld.admin.ch' \

  --data-raw 'query= prefix+xsd%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%23%3E%0Aprefix+schema%3A+%3Chttp%3A%2F%2Fschema.org%2F%3E%0A%0ASelect+%3Fid+where+%7B%0A+GRAPH+%3Curn%3Abgdi%3Alocation%3Aaddresses%3E+%7B%0A+++%3Fs+a+schema%3APostalAddress+.%0A+++%3Fs+schema%3AdateModified+%3Fdate+.%0A+++%3Fs+schema%3Aidentifier+%3Fid+.%0A++++++++FILTER(%3Fdate+%3D+%222022-06-02%22%5E%5Exsd%3Adate)+%0A++%7D+%0A%7D '

Hope it helps

Lucca Kaiser

unread,
Jun 6, 2022, 7:26:43 AM6/6/22
to GeoAdminCh API
Dear Pasquale,

thank you for the quick response. That sounds very promising. I didn't know there was a Linked Data Service for addresses. I will happily try it out.

Best regards,
Lucca
Reply all
Reply to author
Forward
0 new messages