Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dev:client_coding:javascript_api [2022/07/02 18:22] – [Zotero Search Basics] dstillmandev:client_coding:javascript_api [2024/08/21 03:55] (current) – [Zotero JavaScript API] dstillman
Line 3: Line 3:
 Whereas Zotero's [[dev:web_api|Web API]] allows read and write access to online Zotero libraries, it is also possible to access the local Zotero client through the local JavaScript API. (It is also possible to [[dev/client_coding/direct_sqlite_database_access|directly access the local SQLite database]], but that approach is much more fragile.) Whereas Zotero's [[dev:web_api|Web API]] allows read and write access to online Zotero libraries, it is also possible to access the local Zotero client through the local JavaScript API. (It is also possible to [[dev/client_coding/direct_sqlite_database_access|directly access the local SQLite database]], but that approach is much more fragile.)
  
-Note that the (mostly user-contributed) documentation of the JavaScript API is not comprehensive. If you use the JavaScript API in ways beyond what's described here, please consider expanding this wiki page. +Note that this documentation of the JavaScript API is not comprehensive. If you use the JavaScript API in ways beyond what's described here, please consider expanding this wiki page or suggesting changes in the forums.
- +
 ===== Running Ad Hoc JavaScript in Zotero ===== ===== Running Ad Hoc JavaScript in Zotero =====
  
Line 243: Line 241:
 results: results:
  
-<code javascript>var results = await s.search();</code>+<code javascript>var itemIDs = await s.search();</code>
  
 This returns the item ids in the search as an array. The next thing to do is to get the Zotero items for the array of IDs: This returns the item ids in the search as an array. The next thing to do is to get the Zotero items for the array of IDs:
  
-<code javascript>var items = await Zotero.Items.getAsync(results);</code>+<code javascript>var items = await Zotero.Items.getAsync(itemIDs);</code>
  
 ==== Managing citations and bibliographies ==== ==== Managing citations and bibliographies ====
dev/client_coding/javascript_api.1656800536.txt.gz · Last modified: 2022/07/02 18:22 by dstillman