OSCR

API

OSCR (Open Scientific Code Registry) has a free, keyless, read-only API over its catalogue. It needs no account, token or sign-up. Every route answers a plain GET and returns JSON. The data is the data the pages are built from; it holds no PDF, no full text of a paper and no email address. For a worked reference, with examples in curl, Python and R, read the API guide.

Getting started

Every route starts with /api/v1. The index links to every route:

curl https://openscicode.org/api/v1/

The machine-readable description is an OpenAPI 3.1 document at /api/v1/openapi.json (a static copy is at /data/openapi.json).

The endpoints

RouteWhatExample
/api/v1/openapi.jsonThe OpenAPI document/api/v1/openapi.json
/api/v1/statsThe catalogue's figures/api/v1/stats
/api/v1/paper/{doi}One paper's record/api/v1/paper/10.5555%2Foscr.fixture.1
/api/v1/searchSearch the catalogue (shares the daily search quota)/api/v1/search?q=eeg&size=20
/api/v1/authorsThe authors/api/v1/authors?size=50
/api/v1/journalsThe journals/api/v1/journals?size=50
/api/v1/institutionsThe institutions/api/v1/institutions?size=50
/api/v1/toolsThe tools and libraries/api/v1/tools?size=50
/api/v1/datasetsThe datasets/api/v1/datasets?size=50
/api/v1/{type}/{id}One author, journal, institution, tool or dataset/api/v1/author/0000-0000-0000-0028
/api/v1/repository/{host}/{owner}/{name}One code repository/api/v1/repository/github.com/oscr-fixture/eeg-analysis
/api/v1/blocks/{id}One code block, by its identifier/api/v1/blocks/oscr:b:ZHK95W68S9M1K-N

A DOI contains slashes, so give it URL-encoded in the path, or as the ?doi= query parameter:

https://openscicode.org/api/v1/paper/10.5555%2Foscr.fixture.1
https://openscicode.org/api/v1/paper?doi=10.5555/oscr.fixture.1

Bulk downloads

To extract everything at once, use the static files under /data/. They are served by the CDN, free and with no rate limit, and are rebuilt every night:

/data/articles.csv.gz
One row per paper: DOI, title, journal, date, status, code and data link counts (gzipped).
/data/repositories.csv
One row per repository: host, state, licence, scripts, languages, pinned commit.
/data/alignments.jsonl.gz
One JSON object per aligned paper: its paragraph to code-line matches (paragraph numbers, never text), gzipped.
/data/entities/<type>.json
The full list of authors, journals, institutions, tools, datasets and categories.
/data/papers/NN.json, /data/repos/NN.json
Every paper's and repository's record, sharded (the API reads these for one record at a time).

The authors' scripts (their text) are a separate public dataset on Hugging Face, OpenScientificCodeRegistry/Database, under their verified licences (see the data guide). The site does not serve the whole catalogue as one file, because that file is too large for the hosting. Whether to publish one as a public dataset is the operator's decision.

Rate and caching

The static files and the Hugging Face dataset have no rate limit. The one exception is /api/v1/search: it reads the search database, so each call counts against the site's shared daily free budget. Call it sparingly and cache its answers. Every answer carries a Cache-Control header, so a repeat call within ten minutes is served from the cache.

Licence, terms and citation

The catalogue's facts are open data. The authors' code stays under its own licence, so the bulk downloads hold a file only when its repository's licence allows redistribution and is confirmed by a licence file (see the code policy). Use of the API and the data is covered by the terms of use. To cite OSCR and its records, see Citation.

More

The full API guide has every endpoint with its parameters and a real example in curl, Python and R, pagination, errors, and the versioning policy. The site's source code is public on GitHub.