The unifying REST API for all the OpenCitations Indexes

Version: Version 1.2.0 (2023-11-06)
API URL: https://opencitations.net/index/api/v1
Contact: contact@opencitations.net
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.

Description back to top

This document describe the REST API for accessing the data stored in all the OpenCitations Indexes 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.

If you are going to use the REST APIs within an application/code, we encourage you to get the OpenCitations Access Token and specify it in the "authorization" header of your REST API call. Here is a usage example in Python:


from requests import get

API_CALL = "https://opencitations.net/index/api/v1/references/10.1186/1756-8722-6-59"
HTTP_HEADERS = {"authorization": "YOUR-OPENCITATIONS-ACCESS-TOKEN"}

get(API_CALL, headers=HTTP_HEADERS)

Note: we use certain legacy APIs for historical and compatibility reasons. While we encourage the use of our latest and more efficient V2 APIs, we understand that some applications may still rely on these older endpoints. Please note that legacy APIs may not receive updates or support, and their use may be phased out in the future. We recommend transitioning to our current V2 APIs for improved performance, security, and reliability.

Parameters back to top

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. require=<field_name>: all the rows that have an empty value in the <field_name> specified are removed from the result set - e.g. require=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. require=given_name&require=family_name). In addition, these filtering operations are applied in the order presented above - first all the require 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>?require=doi&filter=date:>2015&sort=desc(date).

Operations back to top

The operations that this API implements are:

/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:

The values of all the fields are prefixed with [index name] =>, so as to cleary identify from where the related data is coming, and can contain one or more information, separated by ;. This is particularly useful when a citation is actually contained in two or more OpenCitations Indexes. In this case, only one row will be returned, and the prefix used in the various data allows one to understand the source Index of such data.

Accepted HTTP method(s) get

Parameter(s) oci: type str, regular expression shape [0-9]+-[0-9]+

Result fields typeoci (str), citing (str), cited (str)

Example/citation/06101801781-06180334099

Exemplar output (in JSON)

[
    {
        "oci": "06101801781-06180334099",
        "citing": "10.7717/peerj-cs.421",
        "cited": "10.1108/jd-12-2013-0166",
        "creation": "2021-03-10",
        "timespan": "P6Y0M1D",
        "journal_sc": "no",
        "author_sc": "no"
    }
]

/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) doi: type str, regular expression shape 10\..+

Result fields typecount (int)

Example/citation-count/10.1142/9789812701527_0009

Exemplar output (in JSON)

[
    {
        "count": "32"
    }
]

/reference-count/{doi} back to operations

This operation retrieves the number of outgoing citations from the bibliographic entity identified by the input DOI.

The field returned by this operation is:

Accepted HTTP method(s) get

Parameter(s) doi: type str, regular expression shape 10\..+

Result fields typecount (int)

Example/reference-count/10.1186/1756-8722-6-59

Exemplar output (in JSON)

[
    {
        "count": "75"
    }
]

/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 gathers all the metadata dynamically upon request from OpenCitations Meta.

Accepted HTTP method(s) get

Parameter(s) dois: type str, regular expression shape \"?10\..+[^_\"]((__|\" \")10\..+[^_])*\"?

Result fields typeauthor (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.1007/s11192-019-03217-6

Exemplar output (in JSON)

[
    {
        "doi": "10.1007/s11192-019-03217-6",
        "citation_count": "43",
        "citation": "10.1371/journal.pone.0270872; 10.1007/s11192-022-04581-6; ; ; 10.1007/978-3-030-96957-8_9; 10.2964/jsik_2020_003; 10.1093/reseval/rvac037; 10.1007/978-3-030-62466-8_28; 10.3897/rio.7.e66264; 10.1186/s12916-022-02644-2; 10.1093/gigascience/giab003; 10.3989/arbor.2021.799007; 10.1145/3540250.3549172; 10.1162/qss_a_00112; 10.1162/qss_a_00023; ; 10.1007/s11192-019-03311-9; ; ; ; ; ; 10.1007/978-3-031-06981-9_18; ; ; 10.1145/3383583.3398584; 10.1162/qss_a_00203; 10.1111/cts.13067; ; 10.5712/rbmfc15(42)2671; 10.1145/3529372.3530953; ; 10.7717/peerj-cs.421; 10.1016/b978-0-12-823723-6.00001-x; 10.3233/sw-210439; 10.3145/thinkepi.2021.e15e04; ; 10.1093/llc/fqac016; 10.1007/s11192-022-04367-w; 10.1007/s11192-021-04191-8; 10.1007/s11192-021-04097-5; 10.1007/s11192-020-03690-4; 10.7717/peerj.13712",
        "reference": "10.6084/m9.figshare.7873559; 10.3233/sw-150197; 10.4103/0976-500x.85940; ; 10.1007/978-3-319-17966-7_10; 10.1007/s11192-009-0146-3; 10.1007/978-3-030-00668-6_8; 10.1007/978-3-319-53637-8_6; 10.6084/m9.figshare.7127816; 10.1016/j.websem.2012.08.001; 10.1007/978-3-319-11955-7_42; 10.1007/978-3-319-11964-9_4; 10.6084/m9.figshare.3443876; 10.1007/978-3-319-68204-4_19; 10.1007/978-3-319-46547-0_16; 10.7717/peerj.4201; 10.3233/ds-190016; 10.1038/nature.2017.21800; 10.1038/sdata.2016.18; 10.6084/m9.figshare.6683855",
        "author": "Heibi, Ivan, 0000-0001-5366-5194; Peroni, Silvio, 0000-0003-0530-4305; Shotton, D M, 0000-0001-5506-523",
        "year": "2019-09-14",
        "title": "Software Review: COCI, The OpenCitations Index Of Crossref Open DOI-to-DOI Citations",
        "source_title": "Scientometrics",
        "volume": "121",
        "issue": "2",
        "page": "1213-1228",
        "source_id": "issn:1588-2861",
        "oa_link": ""
    }
]

/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:

The values of all the fields are prefixed with [index name] =>, so as to cleary identify from where the related data is coming, and can contain one or more information, separated by ;. This is particularly useful when a citation is actually contained in two or more OpenCitations Indexes. In this case, only one row will be returned, and the prefix used in the various data allows one to understand the source Index of such data.

Accepted HTTP method(s) get

Parameter(s) doi: type str, regular expression shape 10\..+

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

Example/citations/10.1186/1756-8722-6-59

Exemplar output (in JSON)

[
    {
        "oci": "06101440095-06190834283",
        "citing": "10.3390/molecules25092135",
        "cited": "10.1186/1756-8722-6-59",
        "creation": "2020-05-02",
        "timespan": "P6Y8M13D",
        "journal_sc": "no",
        "author_sc": "no"
    },
    {
        "oci": "06101524605-06190834283",
        "citing": "10.1016/j.clim.2016.01.012",
        "cited": "10.1186/1756-8722-6-59",
        "creation": "2016-03",
        "timespan": "P2Y6M",
        "journal_sc": "no",
        "author_sc": "no"
    },
    {
        "oci": "06101763144-06190834283",
        "citing": "10.3390/pharmaceutics13081222",
        "cited": "10.1186/1756-8722-6-59",
        "creation": "2021-08-07",
        "timespan": "P7Y11M19D",
        "journal_sc": "no",
        "author_sc": "no"
    },
    ...
]

/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:

The values of all the fields are prefixed with [index name] =>, so as to cleary identify from where the related data is coming, and can contain one or more information, separated by ;. This is particularly useful when a citation is actually contained in two or more OpenCitations Indexes. In this case, only one row will be returned, and the prefix used in the various data allows one to understand the source Index of such data.

Accepted HTTP method(s) get

Parameter(s) doi: type str, regular expression shape 10\..+

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

Example/references/10.1186/1756-8722-6-59

Exemplar output (in JSON)

[
      {
          "oci": "06190834283-06101389277",
          "citing": "10.1186/1756-8722-6-59",
          "cited": "10.1124/dmd.111.040840",
          "creation": "2013-08-19",
          "timespan": "P2Y1M11D",
          "journal_sc": "no",
          "author_sc": "no"
      },
      {
          "oci": "06190834283-06102258727",
          "citing": "10.1186/1756-8722-6-59",
          "cited": "10.1093/hmg/3.10.1743",
          "creation": "2013-08-19",
          "timespan": "P19Y",
          "journal_sc": "no",
          "author_sc": "no"
      },
      {
          "oci": "06190834283-06103522789",
          "citing": "10.1186/1756-8722-6-59",
          "cited": "10.3109/08830185.2012.664797",
          "creation": "2013-08-19",
          "timespan": "P1Y4M29D",
          "journal_sc": "no",
          "author_sc": "no"
      },
      ...
]