Skip to content
Back to skills

Osf Datasets

ASecurity

Access Open Science Framework (OSF) datasets via CLI using osfclient and the OSF v2 API. Load when downloading research datasets, searching public OSF projects, or uploading data to OSF repositories.

  • 61 stars
  • 0 votes
  • 0 copies
  • 8 views
  • Added September 6, 2026
securitybashnodeapi

Works with

  • cli
  • api

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 4 files and shows the line behind each finding

Scanned September 6, 2026

npx -y skills add plurigrid/asi --skill osf-datasets --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Osf Datasets?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Osf Datasets
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/plurigrid-osf-datasets/badge)](https://www.skillsdirectory.com/skills/plurigrid-osf-datasets)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: osf-datasets
description: Access Open Science Framework (OSF) datasets via CLI using osfclient and the OSF v2 API. Load when downloading research datasets, searching public OSF projects, or uploading data to OSF repositories.
---

# OSF Datasets

## Setup

```bash
pip install osfclient
```

## Authentication

```bash
# Option A: Personal Access Token (preferred) -- generate at osf.io/settings/tokens
export OSF_TOKEN=<pat>

# Option B: credentials
export OSF_USERNAME=user@example.com
export OSF_PASSWORD=pass
```

Or per-directory `.osfcli.config`:

```ini
[osf]
username = user@example.com
project = abc12
```

## Project ID

The 5-character alphanumeric slug from any `osf.io/<id>` URL. Example: `osf.io/abc12` -> project ID is `abc12`.

## Core Commands

| Command | Purpose |
|---|---|
| `osf -p <id> ls` | List all files |
| `osf -p <id> clone [dir]` | Download entire project |
| `osf -p <id> fetch osfstorage/path.csv local.csv` | Download single file |
| `osf -p <id> upload local.csv osfstorage/path.csv` | Upload file |
| `osf -p <id> geturl osfstorage/path.csv` | Get web URL |

Remote paths are prefixed with the storage provider, typically `osfstorage/`.

## Direct API Access

Base URL: `https://api.osf.io/v2/`

Use `--globoff` with curl -- OSF query params use `[]` which curl interprets as glob ranges.

```bash
# List project files
curl -sL --globoff "https://api.osf.io/v2/nodes/<id>/files/osfstorage/" | jq '.data[].attributes.name'

# Get project metadata
curl -sL --globoff "https://api.osf.io/v2/nodes/<id>/" | jq '.data.attributes'

# Search public nodes by title
curl -sL --globoff "https://api.osf.io/v2/nodes/?filter[title]=keyword&page[size]=20" | jq '.data[] | {id, title: .attributes.title}'

# Browse subfolder (use folder ID from parent listing)
curl -sL --globoff "https://api.osf.io/v2/nodes/<id>/files/osfstorage/<folder_id>/" | jq '.data[].attributes.name'

# With auth
curl -sL --globoff -H "Authorization: Bearer $OSF_TOKEN" "https://api.osf.io/v2/nodes/<id>/files/osfstorage/"
```

File download links are in `data[].links.download` -- follow redirects with `curl -L -o`.

## Helper Scripts

- `scripts/osf-search.sh <keyword> [page_size]` -- search public OSF projects by keyword
- `scripts/osf-browse.sh <project_id> [path]` -- browse project files via API (no osfclient needed)

## Guidelines

- Public projects need no auth; private ones require `OSF_TOKEN` or credentials
- `clone` mirrors the remote directory structure locally
- `fetch` requires both remote and local path arguments
- The API paginates at 10 items by default; use `?page[size]=100` for larger listings
- Rate limits apply -- add brief sleeps for batch operations

Files in this skill

  • CONCOMITANT_SKILLS.md394 B
  • SKILL.md2.6 KB
  • scripts/osf-browse.sh593 B
  • scripts/osf-search.sh455 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in security →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.