Downloads and saves a Zotero reference library (or a subset) and saves it as BibTeX file.
fetch_zotero_refs(
x,
bib_name,
API_key = NULL,
collection = NULL,
lib_type = "user"
)
Character. Zotero user or group ID, see details.
Character. Name of the BibTeX-file references are saved to.
Character. Zotero API key, see details.
Character. Optional ID of a collection in the Zotero library, see details.
Character. Specifies if the supplied ID is associated with a Zotero user
or group
.
Returns bib_name
invisibly.
This function retrieves references through the Zotero web API. x
takes a Zotero user or group ID that can
be retrieved from the Zotero.org user or group Feeds/API settingshttps://www.zotero.org/settings/keys.
An authentication key (API_key
) is required to access nonpublic Zotero libraries using the Zotero API.
Authentication keys can also be generated in the Zotero.org user or group
Feeds/API settingshttps://www.zotero.org/settings/keys.
If the requested reference collection is larger than 100 records, multiple API calls are initiated because the number of retrieved records is limited to 100 per API call. Frequent API calls will result in a temporary access block. Thus, there is an (currently unknown) upper limit to the length of reference collections that can be retrieved through this function. It is generally advisable to comment out the use of this function during periods in which the R Markdown file is frequently rebuilt to limit the number of API calls and limit the number of references to those needed for the current document by setting up collections in your Zotero library.
Collection keys (collection
), i.e. identifiers of reference library subsets, can be retrieved by accessing
them via a web browser. They keys are contained in the URL:
https://www.zotero.org/<USERNAME>/items/collectionKey/<COLLECTIONKEY>
Zotero web API calls can be slow, especially for large reference collections. If available, this function will utilize the downloader-package, which speeds up reference downloads considerably.