# OSF Open Science Framework Scraper (`ninhothedev/osf-scraper`) Actor

$0.5/1K 🔥 OSF Open Science! Extract preprints, projects & contributors from OSF. No key. JSON, CSV, Excel or API in seconds. Track open-science outputs and authors ⚡

- **URL**: https://apify.com/ninhothedev/osf-scraper.md
- **Developed by:** [ninhothedev](https://apify.com/ninhothedev) (community)
- **Categories:** Developer tools, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## OSF Open Science Framework Scraper

Scrape open-science **projects (nodes)**, **preprints**, and **preregistrations (registrations)** from [OSF, the Open Science Framework](https://osf.io) — with titles, descriptions, DOIs, subjects, tags, licenses, dates, and (optionally) contributor names. **No API key required.**

Built on the keyless read tier of the **OSF API v2** (`https://api.osf.io/v2`), which returns data in **JSON:API** format. Runs at roughly **~$0.5 per 1,000 records**.

### What is OSF (and how is it different from Figshare / Zenodo)?

OSF is the free scholarly infrastructure run by the Center for Open Science. It is **not** a file-repository like Figshare or Zenodo — it is a **research-workflow hub**:

| Platform | Core object | What you get |
|----------|-------------|--------------|
| **OSF** (this actor) | **Projects, preregistrations, preprints** | The living research project: hypotheses registered *before* data collection, project structure, preprints, contributors. |
| **Figshare** ([ninhothedev/figshare-scraper](https://apify.com/ninhothedev/figshare-scraper)) | Published **datasets & figures** | Individual research outputs with DOIs. |
| **Zenodo** ([ninhothedev/zenodo-scraper](https://apify.com/ninhothedev/zenodo-scraper)) | Archived **datasets, software, publications** | CERN-hosted long-term archive records. |

In short: **OSF = the open-science *process*** (projects + preregistrations + preprints); Figshare/Zenodo = the archived *artifacts*. If you want to track **what researchers said they would do before they did it** (preregistration), OSF is the source.

### JSON:API note

OSF speaks JSON:API: every response `data` is a **list** of resource objects shaped `{"id", "type", "attributes", "relationships", "links"}`. The real fields live under `attributes`, the web link under `links.html`, and related collections (like contributors) under `relationships`. This actor flattens all of that into clean, one-level records for you.

### Modes

Pick with the `mode` input:

- **`preprints`** (default) — OSF-hosted preprints (PsyArXiv, SocArXiv, etc.) with `doi`, `subjects`, publication dates.
- **`nodes`** — public research projects; optionally enriched with contributor names.
- **`registrations`** — preregistrations, with the registration schema and registration date.

### Input

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `mode` | select | `preprints` | `nodes`, `preprints`, or `registrations`. |
| `searchQuery` | string | — | Title keyword filter (OSF `filter[title]`). E.g. `climate`. |
| `enrichContributors` | boolean | `false` | Nodes only. One extra API call per project to add contributor names. |
| `maxItems` | integer | `200` | 1–3000. |

> OSF has **no keyless full-text `/search/` endpoint** (it returns 404 without a token), so `searchQuery` filters on the **title** field via `filter[title]`.

### Output examples

**Preprint**

```json
{
  "type": "preprint",
  "preprint_id": "9vt5b_v2",
  "title": "Voice Can Help and Hurt AI Empathy",
  "doi": "10.31234/osf.io/9vt5b_v2",
  "is_published": true,
  "date_published": "2025-03-01T00:00:00+00:00",
  "subjects": ["Social and Behavioral Sciences", "Affect and Emotion Regulation"],
  "html_url": "https://osf.io/preprints/psyarxiv/9vt5b_v2/",
  "source": "osf"
}
```

**Node (project)**

```json
{
  "type": "osf_node",
  "node_id": "jyq3r",
  "title": "How much evidence for climate-driven dengue transmission survives the analyst?",
  "category": "project",
  "is_public": true,
  "is_registration": false,
  "tags": ["climate"],
  "contributors": ["Jane Doe"],
  "contributor_count": 1,
  "html_url": "https://osf.io/jyq3r/",
  "source": "osf"
}
```

**Registration**

```json
{
  "type": "registration",
  "registration_id": "abc12",
  "title": "Preregistration of ...",
  "registration_schema": "OSF Preregistration",
  "date_registered": "2026-08-11T02:00:43+00:00",
  "is_public": true,
  "source": "osf"
}
```

### Use cases

- **Meta-research** — study how open science is practiced at scale.
- **Preregistration tracking** — monitor new preregistrations in a field.
- **Preprint discovery** — surface fresh preprints with DOIs and subjects.
- **Open science monitoring** — watch projects/registrations by keyword.

### Rate limits (observed)

The keyless read tier is generous. In testing, a burst of 30 rapid requests returned **zero HTTP 429s** (one transient 502, auto-retried); OSF does **not** expose `X-RateLimit-*` headers. Each request takes ~1.5s. This actor paces requests (short delay, `page[size]=50`, batches ≤ 50) and, if a 429 ever occurs, fails with a **distinct rate-limit message**. For very large jobs, add an OSF token upstream if you need higher throughput (not required here).

### Related actors

- [Figshare Scraper](https://apify.com/ninhothedev/figshare-scraper)
- [Zenodo Scraper](https://apify.com/ninhothedev/zenodo-scraper)
- [Dryad Datasets Scraper](https://apify.com/ninhothedev/dryad-datasets-scraper)
- [Semantic Scholar Scraper](https://apify.com/ninhothedev/semantic-scholar-scraper)

### Local development

```bash
python3 tests/test_mapping.py   # offline smoke tests (stdlib only)
```

No API key. Data © their respective authors; OSF content is generally openly licensed — check each record's `license`.

# Actor input Schema

## `mode` (type: `string`):

Which OSF collection to scrape. 'nodes' = public research projects, 'preprints' = preprints (with DOIs and subjects), 'registrations' = preregistrations. This maps to the OSF API v2 endpoint used.

## `searchQuery` (type: `string`):

Optional keyword used as a title filter (OSF filter\[title]). Example: 'climate'. Leave empty to page through the newest records of the chosen type. OSF has no keyless full-text /search/ endpoint, so this filters on the title field.

## `enrichContributors` (type: `boolean`):

If enabled and mode is 'nodes', makes one extra OSF API call per project to fetch the list of contributor names. Slower but adds authorship data. Ignored for preprints and registrations.

## `maxItems` (type: `integer`):

Maximum number of records to collect before stopping. Range 1-3000. OSF holds hundreds of thousands of records per type, so paging is capped here.

## Actor input object example

```json
{
  "mode": "preprints",
  "searchQuery": "climate",
  "enrichContributors": false,
  "maxItems": 200
}
```

# Actor output Schema

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

No description

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("ninhothedev/osf-scraper").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("ninhothedev/osf-scraper").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 '{}' |
apify call ninhothedev/osf-scraper --silent --output-dataset

```

## MCP server setup

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

```

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/gHWrucMaKLjBa5jKJ/builds/iL5gkrXRuauveqG8G/openapi.json
