# OpenCitations REST API Citation Link Scraper (`plainkitbin/opencitations-citations`) Actor

Fetch open citation metadata linking scholarly papers by DOI from the OpenCitations Index REST API as structured JSON. Not affiliated with OpenCitations.

- **URL**: https://apify.com/plainkitbin/opencitations-citations.md
- **Developed by:** [PlainKit bin](https://apify.com/plainkitbin) (community)
- **Categories:** Developer tools, Education
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.48 / 1,000 opencitations citation records

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## OpenCitations Citations Scraper

OpenCitations Citations Scraper enables academic researchers, bibliometricians, and data engineers to extract citation metadata and reference relationships linking scholarly publications by DOI from the OpenCitations Index REST API as structured JSON data. This scraper is not affiliated with OpenCitations COCI / Index REST API (open citation metadata, CC0 1.0 Universal).

### Introduction

Understanding citation linkages between scientific publications is essential for research analytics, literature mapping, and impact assessment. The OpenCitations Index REST API provides CC0 public domain metadata detailing citation connections across hundreds of millions of articles.

This Actor extracts citation records for any given publication DOI in both directions:

- Backward citation mapping: retrieve publications cited by the query paper (references).
- Forward citation mapping: retrieve publications that cite the query paper (citations).

Every record includes the global Open Citation Identifier (OCI), citing DOI, cited DOI, creation date, citation timespan, and flags indicating author and journal self-citations.

### Tutorial

#### Quick start

1. Enter a valid Digital Object Identifier (DOI) such as `10.1186/1756-8722-6-59`.
2. Choose the citation direction under Operation:
   - Select `references` to list papers that your target paper cites.
   - Select `citations` to list papers that cite your target paper.
3. Set `max_items` to specify how many citation records you need.
4. Run the Actor and download the structured dataset in JSON, CSV, or Excel formats.

### Pricing

This Actor charges using the Apify Pay-Per-Event pricing model. You pay only for successfully retrieved and pushed citation records.

- Event name: `opencitations-citation`
- Pricing tiers:
  - FREE: $0.005 per event
  - BRONZE: $0.0045 per event
  - SILVER: $0.004 per event
  - GOLD: $0.003484 per event
  - PLATINUM: $0.003484 per event
  - DIAMOND: $0.003334 per event

Each citation row is pushed first to the dataset and charged right after a successful push. A refused charge or reached spending limit halts work immediately; that row remains delivered and uncharged. Failed requests produce 0 charges and push no data. If a run restarts or resumes, already delivered records are preserved without double charging.

### Input and output examples

#### Input example

```json
{
  "doi": "10.1186/1756-8722-6-59",
  "operation": "references",
  "max_items": 5
}
```

#### Output example

```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"
}
```

### Actor recommendations

To enhance your scholarly data pipelines, consider combining this Actor with:

- `openalex-works`: Search and discover scientific literature, author profiles, and institutional metrics across OpenAlex.
- `arxiv-papers`: Fetch preprints, research papers, and abstracts directly from arXiv.
- `article-extract`: Scrape full-text articles and extract article bodies from scientific websites.

### FAQ and support

#### Is the data permitted for commercial reuse?

Yes. The metadata provided by OpenCitations is released under the Creative Commons CC0 1.0 Universal Public Domain Dedication, permitting open commercial and non-commercial reuse.

#### What happens if the server refuses a request?

If the OpenCitations API returns a refusal status code (such as 401, 403, or 429), the Actor stops immediately and outputs a single status row with the reason code without charging for it.

#### How can I get support?

For questions, feature requests, or technical feedback, contact support through the Apify platform or email us at support@example.com.

# Actor input Schema

## `doi` (type: `string`):

Digital Object Identifier (DOI) of the scholarly publication (e.g. 10.1186/1756-8722-6-59).

## `operation` (type: `string`):

Direction to traverse: 'references' retrieves publications cited by the DOI; 'citations' retrieves publications citing the DOI.

## `max_items` (type: `integer`):

Maximum number of citation records to deliver.

## Actor input object example

```json
{
  "doi": "10.1186/1756-8722-6-59",
  "operation": "references",
  "max_items": 5
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset items produced by this run.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "doi": "10.1186/1756-8722-6-59",
    "operation": "references",
    "max_items": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("plainkitbin/opencitations-citations").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "doi": "10.1186/1756-8722-6-59",
    "operation": "references",
    "max_items": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("plainkitbin/opencitations-citations").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "doi": "10.1186/1756-8722-6-59",
  "operation": "references",
  "max_items": 5
}' |
apify call plainkitbin/opencitations-citations --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,plainkitbin/opencitations-citations"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/YkLsFYNRRj8boMYRJ/builds/u3dzUhYTgme3Zzhto/openapi.json
