Skip to content

OSF Preprints upstream quirks

The facts below describe the live API at https://api.osf.io/v2/. They shape choices in this client, and the upstream documentation does not always state them.

Paging

  • List routes paginate with a numeric page parameter and honor page[size]. The cap is 100 records per page on every route except the provider list, which defaults to and accepts page[size] up to 1000. Larger values are silently clamped, and the answer reports the clamped value as links.meta.per_page.
  • The pagination total is not meta.total; it lives under links.meta.total. The client's unwrapper reads it there.
  • There is no cursor paging. links.next carries the next page number.
  • links.first is null on page 1 and points at the route root from page 2 on.
  • List windows are not stable while records arrive. During one run, four consecutive pages of 100 newest-first records held 366 unique records, because new submissions shifted the window between requests. The client reports what each page served; no duplicates appeared in that run.
  • Every entity path needs its trailing slash. The slash-less path answers a 301 redirect, and the client does not follow redirects, so all paths in this client keep the slash.

Sorting and searching

  • sort accepts date_created, date_modified, and date_published, each also with a - prefix for descending order. Any other value is silently ignored and the answer comes back in the default order (newest first), so the client rejects unknown sorts with ConfigurationError before sending.
  • The list routes have no free-text search: a q parameter is silently ignored. Narrow results with filters instead.

Filters

  • Unknown filter names answer 400 with "Value '<name>' is not a filterable field." (or "'<name>' is not a valid field for this endpoint." on some routes), so PreprintFilters and ProviderFilters carry only filters the API accepted.
  • Boolean filters are honored: filter[is_published]=false answers a total of 0, while every record in the corpus is published.
  • Date filters accept comparison sub-keys: filter[date_created][gte]=2025-01-01, and likewise [gt], [lte], and [lt]. An unparseable date value is silently ignored.
  • filter[provider] matches the provider id (osf, psyarxiv).
  • Not filterable despite the attributes existing: doi, is_latest_version, date_withdrawn, has_coi, has_data_links, has_prereg_links.
  • On the provider list route, filter[name] matches the exact name; osf does not match Open Science Framework.

Records

  • original_publication_date is a date on some records and a full datetime (2025-09-15T04:00:00) on others; the model accepts both.
  • The osf provider serves additional_providers as an empty list where other providers serve a boolean, and one provider serves facebook_app_id as an integer; the model accepts both shapes.
  • footer_links is an empty string when a provider has no footer links and a list of link objects otherwise.
  • required_fields on a license record is a list of plain field-name strings on some providers (year, copyrightHolders) and an empty list on others.
  • The documented route GET /providers/preprints/{id}/ serves a shorter attribute set than the legacy alias GET /preprint_providers/{id}/, which adds banner_path, email_contact, header_text, logo_path, social_facebook, social_instagram, social_twitter, and subjects_acceptable. This client calls the documented route; the extra attributes stay None there.
  • GET /preprints/{id}/files/ lists storage root folders, not files. The primary file record appears under GET /preprints/{id}/files/osfstorage/ with its size and hashes.
  • GET /preprints/{id}/identifiers/ stays empty until the preprint's DOI is registered; the doi attribute of the preprint carries the DOI either way.
  • The citation detail route keeps its citation type (for example webpage) in the same type key the JSON:API envelope uses for its own resource type, so the model moves the attribute to citation_type.
  • GET /preprints/{id}/versions/ serves full preprint records, one per version, with suffixed ids (muryv_v1, muryv_v2).

Embedding

  • embed=provider works on the preprint list routes and adds an embeds object to each record.
  • embed=primary_file on the list route answers HTTP 502 consistently; treat primary file access as primary_file_id plus preprints.storage_files() instead.

Errors

  • A missing record answers 404 with {"errors": [{"detail": "Not found."}]}, which raises NotFoundError.
  • Routes that need a personal token (review actions, moderators, subscriptions, withdrawal requests) answer 401 with "Authentication credentials were not provided." without one.
  • Transient 502 answers occur; the client retries them per its settings.