Conceptually, you can achieve your goal by storing the previous bookmarks list in the extension's local database using appAPI.db.async, comparing it to the current bookmark list obtained using appAPI.bookmarks.getTree, and sending it to your API server using appAPI.request.post.
You can use the following code in your background.js file as your starting point for handling the bookmarks lists and write your own comparison function (getChanges) as you require:
appAPI.ready(function() {
// Poll every 30 seconds
setInterval(function() {
appAPI.db.async.get('prevBookmarks', function(value) {
// Load or initialize previous bookmarks list
var prevBookmarks = (value) ? value : {};
// Get current bookmarks
appAPI.bookmarks.getTree(function(nodes) {
// Save bookmark list for next comparison
appAPI.db.async.set('prevBookmarks', nodes);
// In your getChanges functions, traverse the bookmark trees collating
// changes and then post then to your API server using appAPI.request
var changes = getChanges(prevBookmarks, nodes);
appAPI.request.post({
url: http://yourAPIserver.com,
postData: changes,
contentType: 'application/json'
});
});
});
}, 30 * 1000);
});