I want to add a tag "Water" to any dataset that includes data "agua"
Can I use the API to search, find and update all datasets that contain the search string "agua" to add a tag "Water"
Yes, you can search all datasets that contain the word "agua" using the package_search
API action, eg http://demo.ckan.org/api/3/action/package_search?q=agua
Once you have them you can either:
package_update
action (sending the whole package object, not just the tag)For each of the returned results, call the package_patch
action, sending the updated tags (make sure to include the existing ones), eg :
{"tags": [{"name": "Water"}, {"name": "OtherTag"}]}
Hope this helps