Citoid/API

This document describes how to interact with the citoid service.

Currently there is one supported endpoint, . There is a publicly available installation of this endpoint at https://citoid.wikimedia.org/api.

For developers, you will find this endpoint at http://localhost:1970/api by default.

The API endpoint accepts GET data. In the GET request, three arguments are accepted:,  , and.

Arguments

 * currently takes URLs, DOIs, PMCIDs, and PMIDs. If the DOI, PMCID, or PMID is unresolvable, you will get back a 404 response and a JSON error message. If the URL is unresolvable, or if the the type is indeterminable, or if there are HTTP status errors at the URL, you will get back a 520 response and a citation with very little metadata.


 * takes ,   and  .  is the format used by the zotero service, and is the format that citoid uses internally.   is the targeted format, and is designed for use by TemplateData maps found in citation templates. You may find, depending on your use case, for the    format to be richer.


 * is an optional boolean argument. If  is set to   (or 1), it will return the base fields for the data in addition to the mapped fields. For example, it will return   in addition to   or.

Headers
To try to request a website in a particular language, you can set the  header in your request, and citoid will attempt to retrieve the website in that language.

This will not work for any request results coming from Zotero since Zotero does not have this feature. It also may not work if the website does not use the accept-request header in order to determine what language to return the sites in.

Response
A successful (200 ok) citoid response consists of an Array of citation Objects,  in the body. At present, there is guaranteed to be only one citation Object in the Array.

A nearly complete list of all itemTypes possible and each itemType's respective parameters are available from Zotero here.

Parameters for which there is no value will not be included in the response. There are a three required parameters that will always be returned: ,   and.

The   format uses the same itemTypes and parameter names as the   format, with three additional parameters: ,  , and. The value of  or   is an Array containing Strings.

The parameter  is an optional parameter array containing four possible values: ,  ,  , and. It indicates where the metadata was retrieved from.

Unsuccessful response
Alongside regular errors (400 Bad Request), we have a custom 520 response that returns a citation object even if no data is able to be retrieved.

Sample output
Below are sample outputs of two of the export formats. The primary difference is in how creators/authors/editors are handled. In, these are all in the   object, and in   they are in a list of   lists keyed by the creatorType value. In only, ISBN and ISSN are lists.