REST API for CROCI, the Croudsourced Open Citations Index

Version: Version 1.1.0 (2020-03-25)
API URL: https://w3id.org/oc/index/croci/api/v1
Contact: [email protected]
License: This document is licensed with a Creative Commons Attribution 4.0 International License, while the REST API itself has been created using RAMOSE, the Restful API Manager Over SPARQL Endpoints created by Silvio Peroni, which is licensed with an ISC license.

Table of content

  1. Description
  2. Parameters
  3. Operations
    • /references/{doi}: This operation retrieves the citation data for all the outgoing references to other cited works appearing in the reference list of the bibliographic entity identified by the input DOI.
    • /citations/{doi}: This operation retrieves the citation data for all the references appearing in the reference lists of other citing works to the bibliographic entity identified by the input DOI, that constitute the incoming citations of that identified bibliographic entity.
    • /citation/{oci}: This operation retrieves the citation metadata for the citation identified by the input Open Citation Identifier (OCI).
    • /metadata/{dois}: This operation retrieves the bibliographic metadata for each of the bibliographic entities identified by one or more input DOIs.
    • /citation-count/{doi}: This operation retrieves the number of incoming citations to the bibliographic entity identified by the input DOI.

1. Description back to toc

This document describe the REST API for accessing the data stored in CROCI hosted by OpenCitations. This API implements operations to retrieve the citation data for all the references to other works appearing in a particular bibliographic entity, or the citation data for all the references appearing in other works to a particular bibliographic entity, given the DOI of a bibliographic entity, or to retrieve citation data about a particular citation identified by means of its Open Citation Identifier (OCI).

All the present operations return either a JSON document (default) or a CSV document according to the mimetype specified in the Accept header of the request. If you would like to suggest an additional operation to be included in this API, please use the issue tracker of the OpenCitations APIs available on GitHub.

2. Parameters back to toc

Parameters can be used to filter and control the results returned by the API. They are passed as normal HTTP parameters in the URL of the call. They are:

  1. exclude=<field_name>: all the rows that have an empty value in the <field_name> specified are removed from the result set - e.g. exclude=given_name removes all the rows that do not have any string specified in the given_name field.

  2. filter=<field_name>:<operator><value>: only the rows compliant with <value> are kept in the result set. The parameter <operation> is not mandatory. If <operation> is not specified, <value> is interpreted as a regular expression, otherwise it is compared by means of the specified operation. Possible operators are "=", "<", and ">". For instance, filter=title:semantics? returns all the rows that contain the string "semantic" or "semantics" in the field title, while filter=date:>2016-05 returns all the rows that have a date greater than May 2016.

  3. sort=<order>(<field_name>): sort in ascending (<order> set to "asc") or descending (<order> set to "desc") order the rows in the result set according to the values in <field_name>. For instance, sort=desc(date) sorts all the rows according to the value specified in the field date in descending order.

  4. format=<format_type>: the final table is returned in the format specified in <format_type> that can be either "csv" or "json" - e.g. format=csv returns the final table in CSV format. This parameter has higher priority of the type specified through the "Accept" header of the request. Thus, if the header of a request to the API specifies Accept: text/csv and the URL of such request includes format=json, the final table is returned in JSON.

  5. json=<operation_type>("<separator>",<field>,<new_field_1>,<new_field_2>,...): in case a JSON format is requested in return, tranform each row of the final JSON table according to the rule specified. If <operation_type> is set to "array", the string value associated to the field name <field> is converted into an array by splitting the various textual parts by means of <separator>. For instance, considering the JSON table [ { "names": "Doe, John; Doe, Jane" }, ... ], the execution of array("; ",names) returns [ { "names": [ "Doe, John", "Doe, Jane" ], ... ]. Instead, if <operation_type> is set to "dict", the string value associated to the field name <field> is converted into a dictionary by splitting the various textual parts by means of <separator> and by associating the new fields <new_field_1>, <new_field_2>, etc., to these new parts. For instance, considering the JSON table [ { "name": "Doe, John" }, ... ], the execution of dict(", ",name,fname,gname) returns [ { "name": { "fname": "Doe", "gname": "John" }, ... ].

It is possible to specify one or more filtering operation of the same kind (e.g. exclude=given_name&exclude=family_name). In addition, these filtering operations are applied in the order presented above - first all the exclude operation, then all the filter operations followed by all the sort operation, and finally the format and the json operation (if applicable). It is worth mentioning that each of the aforementioned rules is applied in order, and it works on the structure returned after the execution of the previous rule.

Example: <api_operation_url>?exclude=doi&filter=date:>2015&sort=desc(date).

3. Operations back to toc

The operations that this API implements are:

/references/{doi} back to operations

This operation retrieves the citation data for all the outgoing references to other cited works appearing in the reference list of the bibliographic entity identified by the input DOI.

The fields returned by this operation are:

Accepted HTTP method(s): get

Parameter(s):

Result fields: oci (str), citing (str), cited (str), creation (datetime), timespan (duration), ?journal_sc (str), ?author_sc (str)

Example: /references/10.1002/asi.20755

Exemplar output (in JSON)

[
    {
        "journal_sc": "no",
        "author_sc": "no",
        "citing": "10.1002/asi.20755",
        "cited": "10.1007/11839569_35",
        "creation": "2008-01-15",
        "timespan": "P1Y3M12D",
        "oci": "0500100000236102818370200070505-05001000007360101080309050609490305"
    },
    {
        "journal_sc": "no",
        "author_sc": "no",
        "citing": "10.1002/asi.20755",
        "cited": "10.1038/438900a",
        "creation": "2008-01-15",
        "timespan": "P2Y1M0D",
        "oci": "0500100000236102818370200070505-050010003083604030809000010"
    },
    {
        "journal_sc": "no",
        "author_sc": "no",
        "citing": "10.1002/asi.20755",
        "cited": "10.1109/wi.2006.164",
        "creation": "2008-01-15",
        "timespan": "P0Y11M27D",
        "oci": "0500100000236102818370200070505-05001010009363218370200000637010604"
    },
    {
        "journal_sc": "no",
        "author_sc": "no",
        "citing": "10.1002/asi.20755",
        "cited": "10.1142/9789812701527_0009",
        "creation": "2008-01-15",
        "timespan": "P2Y3M14D",
        "oci": "0500100000236102818370200070505-0500101040236090708090801020700010502074900000009"
    }
]

/citations/{doi} back to operations

This operation retrieves the citation data for all the references appearing in the reference lists of other citing works to the bibliographic entity identified by the input DOI, that constitute the incoming citations of that identified bibliographic entity.

The fields returned by this operation are:

Accepted HTTP method(s): get

Parameter(s):

Result fields: oci (str), citing (str), cited (str), creation (datetime), timespan (duration), ?journal_sc (str), ?author_sc (str)

Example: /citations/10.1142/9789812701527_0009

Exemplar output (in JSON)

[
    {
        "journal_sc": "no",
        "author_sc": "no",
        "citing": "10.1002/asi.20755",
        "cited": "10.1142/9789812701527_0009",
        "creation": "2008-01-15",
        "timespan": "P2Y3M14D",
        "oci": "0500100000236102818370200070505-0500101040236090708090801020700010502074900000009"
    }
]

/citation/{oci} back to operations

This operation retrieves the citation metadata for the citation identified by the input Open Citation Identifier (OCI).

The Open Citation Identifier is a globally unique persistent identifier for bibliographic citations, which has a simple structure: the lower-case letters "oci" followed by a colon, followed by two numbers separated by a dash. For example, oci:1-18 is a valid OCI.

It is worth mentioning that, in this REST operation, the prefix "oci:" should not be specified, and only the dash-separated numbers of the OCI should be provided, as shown in the example below.

The fields returned by this operation are:

Accepted HTTP method(s): get

Parameter(s):

Result fields: oci (str), citing (str), cited (str), creation (datetime), timespan (duration), ?journal_sc (str), ?author_sc (str)

Example: /citation/0500100000236102818370200070505-05001000007360101080309050609490305

Exemplar output (in JSON)

[
    {
        "journal_sc": "no",
        "author_sc": "no",
        "citing": "10.1002/asi.20755",
        "cited": "10.1007/11839569_35",
        "creation": "2008-01-15",
        "timespan": "P1Y3M12D",
        "oci": "0500100000236102818370200070505-05001000007360101080309050609490305"
    }
]

/metadata/{dois} back to operations

This operation retrieves the bibliographic metadata for each of the bibliographic entities identified by one or more input DOIs.

It is possible to specify one or more DOIs as input of this operation. In this case, the DOI should be separated with a double underscore ("__") – e.g. "10.1108/jd-12-2013-0166__10.1016/j.websem.2012.08.001__...". The fields returned by this operation are:

Note: this operation strictly depends on external services (i.e. doi.org and associate applications) for gathering all the metadata of the articles requested. In fact, these metadata are not stored in COCI and are retrieved dynamically upon request.

Accepted HTTP method(s): get

Parameter(s):

Result fields: author (str), year (datetime), title (str), source_title (str), source_id (str), volume (str), issue (str), page (str), doi (str), reference (str), citation (str), citation_count (int), oa_link (str)

Example: /metadata/10.1002/asi.20755__10.1145/1501434.1501445

Exemplar output (in JSON)

[
    {
        "source_title": "Journal Of The American Society For Information Science And Technology",
        "reference": "10.1007/11839569_35; 10.1038/438900a; 10.1109/wi.2006.164; 10.1142/9789812701527_0009; 10.1145/1501434.1501445; 10.1145/503376.503456; 10.2307/1562247; 10.2307/2529310; 10.2307/4486062; 10.5210/fm.v11i11.1413; 10.5210/fm.v11i9.1400; 10.5210/fm.v12i4.1763; 10.5210/fm.v8i12.1108",
        "issue": "2",
        "oa_link": "",
        "volume": "59",
        "doi": "10.1002/asi.20755",
        "page": "318-330",
        "author": "Luyt, Brendan; Aaron, Tay Chee Hsien; Thian, Lim Hai; Hong, Cheng Kian",
        "year": "2007",
        "citation": "",
        "source_id": "issn:1532-2882; issn:1532-2890",
        "title": "Improving Wikipedia'S Accuracy: Is Edit Age A Solution?",
        "citation_count": "0"
    },
    {
        "source_title": "Proceedings Of The 2006 International Conference On Privacy, Security And Trust Bridge The Gap Between Pst Technologies And Business Services - Pst '06",
        "reference": "",
        "issue": "",
        "oa_link": "http://www.dtic.mil/cgi-bin/GetTRDoc?AD=ADA454704&Location=U2&doc=GetTRDoc.pdf",
        "volume": "",
        "doi": "10.1145/1501434.1501445",
        "page": "",
        "author": "Zeng, Honglei; Alhossaini, Maher A.; Ding, Li; Fikes, Richard; Mcguinness, Deborah L.",
        "year": "2006",
        "citation": "10.1002/asi.20755",
        "source_id": "",
        "title": "Computing Trust From Revision History",
        "citation_count": "1"
    }
]

/citation-count/{doi} back to operations

This operation retrieves the number of incoming citations to the bibliographic entity identified by the input DOI.

The field returned by this operation is:

Accepted HTTP method(s): get

Parameter(s):

Result fields: count (int)

Example: /citation-count/10.1142/9789812701527_0009

Exemplar output (in JSON)

[
    {
        "count": "1"
    }
]